From: <ale...@us...> - 2014-12-29 16:15:53
|
Revision: 60448 http://sourceforge.net/p/firebird/code/60448 Author: alexpeshkoff Date: 2014-12-29 16:15:49 +0000 (Mon, 29 Dec 2014) Log Message: ----------- Cleanup - remove debris of pre-firebird authentication Modified Paths: -------------- firebird/trunk/src/remote/SockAddr.h firebird/trunk/src/remote/inet.cpp Modified: firebird/trunk/src/remote/SockAddr.h =================================================================== --- firebird/trunk/src/remote/SockAddr.h 2014-12-29 15:48:26 UTC (rev 60447) +++ firebird/trunk/src/remote/SockAddr.h 2014-12-29 16:15:49 UTC (rev 60448) @@ -68,7 +68,6 @@ unsigned length() const { return len; } unsigned short family() const; unsigned short port() const; - bool isLocalhost() const; void setPort(unsigned short x); int connect(SOCKET s) const; int accept(SOCKET s); @@ -169,29 +168,6 @@ } -inline bool SockAddr::isLocalhost() const -{ - const struct sockaddr* sa = (const struct sockaddr*) data; - - switch(sa->sa_family) - { - case AF_INET: - { - const struct sockaddr_in* sa4 = (const struct sockaddr_in*) data; - return ((ntohl(sa4->sin_addr.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET); - } - - case AF_INET6: - { - const struct sockaddr_in6* sa6 = (const struct sockaddr_in6*) data; - return (memcmp(&sa6->sin6_addr, &in6addr_loopback, sizeof(in6_addr)) == 0); - } - } - - return 0; // exception? -} - - // if address is embedded IPv4, convert it to normal IPv4 inline void SockAddr::unmapV4() { Modified: firebird/trunk/src/remote/inet.cpp =================================================================== --- firebird/trunk/src/remote/inet.cpp 2014-12-29 15:48:26 UTC (rev 60447) +++ firebird/trunk/src/remote/inet.cpp 2014-12-29 16:15:49 UTC (rev 60448) @@ -1142,7 +1142,6 @@ cnct->p_cnct_user_id.cstr_address, cnct->p_cnct_user_id.cstr_length); - bool user_verification = false; for (id.rewind(); !id.isEof(); id.moveNext()) { switch (id.getClumpTag()) @@ -1155,28 +1154,12 @@ id.getString(host_name); break; - // this case indicates that the client has requested that - // we force the user name/password to be verified against - // the security database - case CNCT_user_verification: - user_verification = true; - break; - default: break; } } #ifndef WIN_NT - // See if user exists. If not, reject connection - if (!user_verification) - { - if (!check_host(port)) - { - return false; - } - } - { // scope // If the environment variable ISC_INET_SERVER_HOME is set, // change the home directory to the specified directory. @@ -1528,28 +1511,7 @@ return new_port; } -#ifndef WIN_NT -static bool check_host(rem_port* port) -{ -/************************************** - * - * c h e c k _ h o s t ( n o n - W i n d o w s ) - * - ************************************** - * - * Functional description - * Check the host on the other end of the socket to see if it's localhost - * - **************************************/ - SockAddr address; - if (address.getpeername(port->port_handle) < 0) - return false; - - return address.isLocalhost(); -} -#endif // WIN_NT - #if !(defined WIN_NT) static THREAD_ENTRY_DECLARE waitThread(THREAD_ENTRY_PARAM) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |