8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 14:03:03 +01:00

Remove the WNET protocol (#7082)

* Wiped out the WNET support

* Remove the WNET files
This commit is contained in:
Dmitry Yemanov 2022-01-05 10:34:07 +03:00 committed by GitHub
parent e596e03ee0
commit 82da31ccfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 146 additions and 2047 deletions

View File

@ -155,7 +155,6 @@ endif()
set(FB_PREFIX ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME})
set(FB_IPC_NAME "FirebirdIPI")
set(FB_LOGFILENAME "firebird.log")
set(FB_PIPE_NAME "interbas")
set(FB_SERVICE_NAME "gds_db")
set(FB_SERVICE_PORT 3050)

View File

@ -41,9 +41,8 @@
#
# String
# ------
# Strings are also what they sound like, strings. Examples:
# Strings are also what they sound like, strings. Example:
# RemoteServiceName = gds_db
# RemotePipeName = pipe47
#
# Scopes
# ------
@ -1083,18 +1082,6 @@
#
#IpcName = FIREBIRD
#
# The name of the pipe used as a transport channel in NetBEUI protocol.
# Has the same meaning as a port number for TCP/IP. The default value is
# compatible with IB/FB1.
#
# Per-connection configurable.
#
# Type: string
#
#RemotePipeName = interbas
# ============================
# Settings for Unix/Linux platforms
# ============================

View File

@ -6767,16 +6767,6 @@
path = winvx.cpp;
refType = 4;
};
F616C8C00200B0D001EF0ADE = {
isa = PBXFileReference;
path = wnet.cpp;
refType = 4;
};
F616C8C10200B0D001EF0ADE = {
isa = PBXFileReference;
path = wnet_proto.h;
refType = 4;
};
F616C8C20200B0D001EF0ADE = {
isa = PBXFileReference;
path = xdr.cpp;

View File

@ -157,7 +157,6 @@
<ClCompile Include="..\..\..\src\remote\parser.cpp" />
<ClCompile Include="..\..\..\src\remote\protocol.cpp" />
<ClCompile Include="..\..\..\src\remote\remote.cpp" />
<ClCompile Include="..\..\..\src\remote\os\win32\wnet.cpp" />
<ClCompile Include="..\..\..\src\auth\trusted\AuthSspi.cpp" />
</ItemGroup>
<ItemGroup>
@ -165,7 +164,6 @@
<ClInclude Include="..\..\..\src\auth\SecureRemotePassword\srp.h" />
<ClInclude Include="..\..\..\src\remote\inet_proto.h" />
<ClInclude Include="..\..\..\src\remote\merge_proto.h" />
<ClInclude Include="..\..\..\src\remote\os\win32\wnet_proto.h" />
<ClInclude Include="..\..\..\src\remote\os\win32\xnet.h" />
<ClInclude Include="..\..\..\src\remote\os\win32\xnet_proto.h" />
<ClInclude Include="..\..\..\src\remote\parse_proto.h" />

View File

@ -29,9 +29,6 @@
<ClCompile Include="..\..\..\src\remote\remote.cpp">
<Filter>REMOTE files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\remote\os\win32\wnet.cpp">
<Filter>REMOTE files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\auth\trusted\AuthSspi.cpp">
<Filter>AUTH files</Filter>
</ClCompile>
@ -64,9 +61,6 @@
<ClInclude Include="..\..\..\src\remote\remote.h">
<Filter>Header files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\remote\os\win32\wnet_proto.h">
<Filter>Header files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\remote\os\win32\xnet.h">
<Filter>Header files</Filter>
</ClInclude>

View File

@ -1222,15 +1222,6 @@ case "$PLATFORM" in
;;
win32)
FB_PIPE_NAME=interbas
AC_ARG_WITH(pipe-name,
[ --with-pipe-name specify wnet pipe name (default=interbas)],
[FB_PIPE_NAME=${withval}])
AH_VERBATIM(FB_PIPE_NAME,
[/* Wnet pipe name */
#define FB_PIPE_NAME "interbas"])
AC_DEFINE_UNQUOTED(FB_PIPE_NAME,"$FB_PIPE_NAME")
AC_SUBST(FB_PIPE_NAME)
XE_PREPEND( -mthreads -lmpr -lversion -lws2_32 -lole32,LIBS)
;;
@ -1503,10 +1494,6 @@ esac
echo " Service name : $FB_SERVICE_NAME"
echo " Service port : $FB_SERVICE_PORT"
case "$PLATFORM" in
win32) echo " Pipe name : $FB_PIPE_NAME";;
esac
echo " GPRE modules : c_cxx.cpp$GPRE_LANGUAGE_MODULES"
echo

View File

@ -94,9 +94,8 @@ you only use 0/1
String
------
Strings are also what they sound like, strings. Examples:
Strings are also what they sound like, strings. Example:
RootDirectory = /opt/firebird
RemotePipeName = "pipe47"
Configuration options
@ -144,8 +143,7 @@ DeadThreadsCollection integer default 50
PriorityBoost integer default 5
RemoteServiceName string default gds_db
RemoteServicePort integer default 3050 (TCP port number)
RemotePipeName string default "interbas" (Windows only?)
IpcName string default "FirebirdIPI" (Windows only)
IpcName string default "FIREBIRD" (Windows only)
MaxUnflushedWrites integer
# of writes before file writes are forcibly synched.

View File

@ -10,10 +10,6 @@ For TCP (aka INET) protocol:
<host> [ / <port>] : <file path to database or alias>
For named pipes (aka NetBEUI, aka WNET) protocol:
\\ <host> [ @ <port>] \ <file path to database or alias>
For local connections as simple as:
<file path to database or alias>
@ -55,11 +51,6 @@ Examples:
myserver/fb_db:mydb
localhost/fb_db:mydb
Connect via named pipes:
\\myserver\C:\db\mydb.fdb
\\myserver@fb_db\C:\db\mydb.fdb
Local connection:
/db/mydb.fdb
@ -71,8 +62,7 @@ connection strings:
[ <protocol> : // [ <host> [ : <port> ] ] ] / <file path to database or alias>
Where protocol is one of: INET (means TCP), WNET (means named pipes) or XNET
(means shared memory).
Where protocol is one of: INET (means TCP) or XNET (means shared memory).
Examples:
@ -114,22 +104,12 @@ Examples:
inet4://myserver/mydb
inet6://myserver/mydb
Connect via named pipes:
wnet://myserver/C:\db\mydb.fdb
wnet://myserver:fb_db/C:\db\mydb.fdb
Loopback connection via TCP:
inet:///db/mydb.fdb
inet://C:\db\mydb.fdb
inet://mydb
Loopback connection via named pipes:
wnet://C:\db\mydb.fdb
wnet://mydb
Local connection via shared memory:
xnet://C:\db\mydb.fdb
@ -155,9 +135,7 @@ to connect locally using a specific transport protocol, please specify:
inet://<file path to database or alias>
or
wnet://<file path to database or alias>
or
xnet://<file path to database or alias>
Note: WNET (named pipes) and XNET (shared memory) protocols are available on Windows only.
Note: XNET (shared memory) protocol is available on Windows only.

View File

@ -48,7 +48,7 @@ Usage:
Variable name Value
------------------------------------------------------------------------------
NETWORK_PROTOCOL | The network protocol used by client to connect. Currently
| used values: "TCPv4", "TCPv6", "WNET", "XNET" and NULL.
| used values: "TCPv4", "TCPv6", "XNET" and NULL.
|
WIRE_COMPRESSED | Compression status of current connection.
| If connection is compressed - returns "TRUE", if it is

View File

@ -98,30 +98,21 @@ struct user_action
// String block: used to store a string of constant length.
class alice_str : public pool_alloc_rpt<UCHAR, alice_type_str>
{
public:
USHORT str_length;
UCHAR str_data[2];
};
// Transaction block: used to store info about a multi-database transaction.
// Transaction Description Record
struct tdr : public pool_alloc<alice_type_tdr>
{
tdr* tdr_next; // next sub-transaction
TraNumber tdr_id; // database-specific transaction id
alice_str* tdr_fullpath; // full (possibly) remote pathname
const TEXT* tdr_filename; // filename within full pathname
alice_str* tdr_host_site; // host for transaction
alice_str* tdr_remote_site; // site for remote transaction
FB_API_HANDLE tdr_handle; // reconnected transaction handle
FB_API_HANDLE tdr_db_handle; // re-attached database handle
USHORT tdr_db_caps; // capabilities of database
USHORT tdr_state; // see flags below
tdr* tdr_next; // next sub-transaction
TraNumber tdr_id; // database-specific transaction id
Firebird::string tdr_fullpath; // full (possibly) remote pathname
Firebird::string tdr_filename; // filename
Firebird::string tdr_host_site; // host for transaction
Firebird::string tdr_remote_site; // site for remote transaction
FB_API_HANDLE tdr_handle; // reconnected transaction handle
FB_API_HANDLE tdr_db_handle; // re-attached database handle
USHORT tdr_db_caps; // capabilities of database
USHORT tdr_state; // see flags below
};
// CVC: This information should match Transaction Description Record constants in acl.h

View File

@ -39,6 +39,7 @@
#include "../common/classes/UserBlob.h"
#include "../alice/alice_proto.h"
#include "../common/utils_proto.h"
#include "../common/isc_f_proto.h"
#include <string.h>
@ -54,7 +55,7 @@ DATABASE DB = STATIC FILENAME "yachts.lnk";
typedef Firebird::HalfStaticArray<TEXT, 1024> TextBuffer;
static alice_str* alloc_string(const TEXT**);
static void get_string(const TEXT**, Firebird::string&);
static USHORT get_capabilities(ISC_STATUS*);
static tdr* get_description(ISC_QUAD*);
static void parse_fullpath(tdr*);
@ -242,19 +243,15 @@ void MET_set_capabilities(ISC_STATUS* user_status, tdr* trans)
* Eat a string with a byte-encoded length.
*/
static alice_str* alloc_string(const TEXT** ptr)
static void get_string(const TEXT** ptr, Firebird::string& str)
{
AliceGlobals* tdgbl = AliceGlobals::getSpecific();
const TEXT* p = *ptr;
const USHORT length = (USHORT) *p++;
alice_str* string = FB_NEW_RPT(*tdgbl->getDefaultPool(), length + 1) alice_str;
memcpy(string->str_data, p, length);
string->str_data[length] = 0;
*ptr = p + length;
return string;
str.assign(p, length);
}
@ -319,8 +316,8 @@ static tdr* get_description(ISC_QUAD* blob_id)
return NULL;
tdr* trans = NULL;
alice_str* host_site = NULL;
alice_str* database_path = NULL;
Firebird::string host_site;
Firebird::string database_path;
const TEXT* p = buffer.begin();
@ -336,11 +333,11 @@ static tdr* get_description(ISC_QUAD* blob_id)
switch (*p++)
{
case TDR_HOST_SITE:
host_site = alloc_string(&p);
get_string(&p, host_site);
break;
case TDR_DATABASE_PATH:
database_path = alloc_string(&p);
get_string(&p, database_path);
break;
case TDR_TRANSACTION_ID:
@ -359,7 +356,7 @@ static tdr* get_description(ISC_QUAD* blob_id)
ptr->tdr_fullpath = database_path;
parse_fullpath(ptr);
ptr->tdr_id = id;
database_path = NULL;
database_path.clear();
break;
default:
@ -382,73 +379,17 @@ static tdr* get_description(ISC_QUAD* blob_id)
static void parse_fullpath(tdr* trans)
{
AliceGlobals* tdgbl = AliceGlobals::getSpecific();
Firebird::PathName filename = trans->tdr_fullpath.c_str();
Firebird::PathName hostname;
// start at the end of the full pathname
// Find the last remote node in the path
const TEXT* p = (TEXT*) trans->tdr_fullpath->str_data;
const TEXT* const start = p;
while (*p)
p++;
const TEXT* const end = p;
while (ISC_analyze_tcp(filename, hostname))
trans->tdr_remote_site = hostname.c_str();
// Check for a named pipes name - \\node\path\db or //node/path/db
while (p > start && !(*p == '/' && p[-1] == '/') && !(*p == '\\' && p[-1] == '\\'))
{
--p;
}
// At this point the filename is clear from any remote nodes
if (p > start)
{
// Increment p past slash, & search forward for end of node name
p = p + 1;
const TEXT* q = p;
while (*q && *q != '/' && *q != '\\')
q++;
if (*q)
{
trans->tdr_filename = q + 1;
trans->tdr_remote_site = FB_NEW_RPT(*tdgbl->getDefaultPool(), q - p + 1) alice_str;
fb_utils::copy_terminate((char*) trans->tdr_remote_site->str_data, (char*) p, q - p + 1);
}
}
else
{
p = end;
// If not named pipes, check the other protocols
// work backwards until we find a remote protocol specifier
while (p >= start && (*p != '^' && *p != ':' && *p != '@'))
p--;
// dimitr: make sure that the remote path is parsed correctly
// for win32 servers, i.e. the drive separator is taken into account
if ((p - 2 >= start) && p[-2] == ':' && (p[0] == ':'))
p -= 2;
trans->tdr_filename = p + 1;
// now find the last remote node in the chain
while (p > start && (*p == ':' || *p == '^' || *p == '@'))
p--;
USHORT length = 0;
for (; p >= start && (*p != '^' && *p != ':' && *p != '@'); ++length)
--p;
++p;
if (length)
{
trans->tdr_remote_site = FB_NEW_RPT(*tdgbl->getDefaultPool(), length + 1) alice_str;
TEXT* q = (TEXT *) trans->tdr_remote_site->str_data;
while (length--)
*q++ = *p++;
*q = 0;
}
}
trans->tdr_filename = filename.c_str();
}

View File

@ -472,7 +472,7 @@ bool TDR_reconnect_multiple(FB_API_HANDLE handle, TraNumber id, const TEXT* name
{
if (ptr->tdr_state == TRA_limbo)
{
reconnect(ptr->tdr_db_handle, ptr->tdr_id, ptr->tdr_filename, switches);
reconnect(ptr->tdr_db_handle, ptr->tdr_id, ptr->tdr_filename.c_str(), switches);
}
}
}
@ -504,28 +504,23 @@ static void print_description(const tdr* trans)
AliceGlobals* tdgbl = AliceGlobals::getSpecific();
if (!trans)
{
return;
}
if (!tdgbl->uSvc->isService())
{
ALICE_print(92); // msg 92: Multidatabase transaction:
}
bool prepared_seen = false;
for (const tdr* ptr = trans; ptr; ptr = ptr->tdr_next)
{
if (ptr->tdr_host_site)
const auto host_site = ptr->tdr_host_site.nullStr();
if (host_site)
{
const char* pszHostSize = reinterpret_cast<const char*>(ptr->tdr_host_site->str_data);
if (!tdgbl->uSvc->isService())
{
// msg 93: Host Site: %s
ALICE_print(93, SafeArg() << pszHostSize);
ALICE_print(93, SafeArg() << host_site);
}
tdgbl->uSvc->putLine(isc_spb_tra_host_site, pszHostSize);
tdgbl->uSvc->putLine(isc_spb_tra_host_site, host_site);
}
if (ptr->tdr_id)
@ -586,28 +581,26 @@ static void print_description(const tdr* trans)
break;
}
if (ptr->tdr_remote_site)
const auto remote_site = ptr->tdr_remote_site.nullStr();
if (remote_site)
{
const char* pszRemoteSite = reinterpret_cast<const char*>(ptr->tdr_remote_site->str_data);
if (!tdgbl->uSvc->isService())
{
// msg 101: Remote Site: %s
ALICE_print(101, SafeArg() << pszRemoteSite);
ALICE_print(101, SafeArg() << remote_site);
}
tdgbl->uSvc->putLine(isc_spb_tra_remote_site, pszRemoteSite);
tdgbl->uSvc->putLine(isc_spb_tra_remote_site, remote_site);
}
if (ptr->tdr_fullpath)
const auto fullpath = ptr->tdr_fullpath.nullStr();
if (fullpath)
{
const char* pszFullpath = reinterpret_cast<const char*>(ptr->tdr_fullpath->str_data);
if (!tdgbl->uSvc->isService())
{
// msg 102: Database Path: %s
ALICE_print(102, SafeArg() << pszFullpath);
ALICE_print(102, SafeArg() << fullpath);
}
tdgbl->uSvc->putLine(isc_spb_tra_db_path, pszFullpath);
tdgbl->uSvc->putLine(isc_spb_tra_db_path, fullpath);
}
}
@ -649,10 +642,9 @@ static void print_description(const tdr* trans)
static SINT64 ask()
{
AliceGlobals* tdgbl = AliceGlobals::getSpecific();
if (tdgbl->uSvc->isService())
{
return ~SINT64(0);
}
char response[32];
SINT64 switches = 0;
@ -694,79 +686,56 @@ static SINT64 ask()
static void reattach_database(tdr* trans)
{
ISC_STATUS_ARRAY status_vector;
char buffer[1024];
char buffer[BUFFER_LARGE];
// sizeof(buffer) - 1 => leave space for the terminator.
const char* const end = buffer + sizeof(buffer) - 1;
AliceGlobals* tdgbl = AliceGlobals::getSpecific();
ISC_get_host(buffer, sizeof(buffer));
if (trans->tdr_fullpath)
if (trans->tdr_fullpath.hasData())
{
Firebird::string hostname;
ISC_get_host(hostname);
// if this is being run from the same host,
// try to reconnect using the same pathname
if (!strcmp(buffer, reinterpret_cast<const char*>(trans->tdr_host_site->str_data)))
if (trans->tdr_host_site == hostname)
{
if (TDR_attach_database(status_vector, trans,
reinterpret_cast<char*>(trans->tdr_fullpath->str_data)))
{
if (TDR_attach_database(status_vector, trans, trans->tdr_fullpath.c_str()))
return;
}
}
else if (trans->tdr_host_site)
else if (trans->tdr_host_site.hasData())
{
// try going through the previous host with all available
// protocols, using chaining to try the same method of
// attachment originally used from that host
char* p = buffer;
const UCHAR* q = trans->tdr_host_site->str_data;
while (*q && p < end)
*p++ = *q++;
*p++ = ':';
q = trans->tdr_fullpath->str_data;
while (*q && p < end)
*p++ = *q++;
*p = 0;
if (TDR_attach_database(status_vector, trans, buffer))
{
const Firebird::string pathname = trans->tdr_host_site + ':' + trans->tdr_fullpath;
if (TDR_attach_database(status_vector, trans, pathname.c_str()))
return;
}
}
// attaching using the old method didn't work;
// try attaching to the remote node directly
if (trans->tdr_remote_site)
if (trans->tdr_remote_site.hasData())
{
char* p = buffer;
const UCHAR* q = trans->tdr_remote_site->str_data;
while (*q && p < end)
*p++ = *q++;
*p++ = ':';
q = reinterpret_cast<const UCHAR*>(trans->tdr_filename);
while (*q && p < end)
*p++ = *q++;
*p = 0;
if (TDR_attach_database (status_vector, trans, buffer))
{
const Firebird::string pathname = trans->tdr_remote_site + ':' + trans->tdr_filename;
if (TDR_attach_database(status_vector, trans, pathname.c_str()))
return;
}
}
}
// we have failed to reattach; notify the user
// and let them try to succeed where we have failed
ALICE_print(86, SafeArg() << trans->tdr_id);
// msg 86: Could not reattach to database for transaction %ld.
ALICE_print(87, SafeArg() << (trans->tdr_fullpath ? (char*)(trans->tdr_fullpath->str_data) : "is unknown"));
ALICE_print(87, SafeArg() << (trans->tdr_fullpath.hasData() ? trans->tdr_fullpath.c_str() : "unknown"));
// msg 87: Original path: %s
if (tdgbl->uSvc->isService())
{
ALICE_exit(FINI_ERROR, tdgbl);
}
for (;;)
{
@ -782,12 +751,8 @@ static void reattach_database(tdr* trans)
++p;
if (TDR_attach_database(status_vector, trans, p))
{
const size_t p_len = strlen(p);
alice_str* string = FB_NEW_RPT(*tdgbl->getDefaultPool(), p_len + 1) alice_str;
strcpy(reinterpret_cast<char*>(string->str_data), p);
string->str_length = static_cast<USHORT>(p_len);
trans->tdr_fullpath = string;
trans->tdr_filename = (TEXT *) string->str_data;
trans->tdr_fullpath.assign(p);
trans->tdr_filename = trans->tdr_fullpath;
return;
}
ALICE_print(89); // msg 89: Attach unsuccessful.

View File

@ -137,7 +137,6 @@ enum ConfigKey
KEY_DEADLOCK_TIMEOUT,
KEY_REMOTE_SERVICE_NAME,
KEY_REMOTE_SERVICE_PORT,
KEY_REMOTE_PIPE_NAME,
KEY_IPC_NAME,
KEY_MAX_UNFLUSHED_WRITES,
KEY_MAX_UNFLUSHED_WRITE_TIME,
@ -232,7 +231,6 @@ constexpr ConfigEntry entries[MAX_CONFIG_KEY] =
{TYPE_INTEGER, "DeadlockTimeout", false, 10}, // seconds
{TYPE_STRING, "RemoteServiceName", false, FB_SERVICE_NAME},
{TYPE_INTEGER, "RemoteServicePort", false, 0},
{TYPE_STRING, "RemotePipeName", false, FB_PIPE_NAME},
{TYPE_STRING, "IpcName", false, FB_IPC_NAME},
#ifdef WIN_NT
{TYPE_INTEGER, "MaxUnflushedWrites", false, 100},
@ -522,9 +520,6 @@ public:
// Service port for INET
CONFIG_GET_PER_DB_KEY(unsigned short, getRemoteServicePort, KEY_REMOTE_SERVICE_PORT, getInt);
// Pipe name for WNET
CONFIG_GET_PER_DB_STR(getRemotePipeName, KEY_REMOTE_PIPE_NAME);
// Name for IPC-related objects
CONFIG_GET_PER_DB_STR(getIpcName, KEY_IPC_NAME);

View File

@ -30,13 +30,15 @@
#include "../common/classes/fb_string.h"
#include "../common/common.h"
enum iscProtocol {ISC_PROTOCOL_LOCAL, ISC_PROTOCOL_TCPIP, ISC_PROTOCOL_WLAN};
enum iscProtocol {ISC_PROTOCOL_LOCAL, ISC_PROTOCOL_TCPIP};
#ifndef NO_NFS
bool ISC_analyze_nfs(Firebird::PathName&, Firebird::PathName&);
#endif
bool ISC_analyze_protocol(const char*, Firebird::PathName&, Firebird::PathName&, const char*, bool needFile);
#ifdef WIN_NT
bool ISC_analyze_pclan(Firebird::PathName&, Firebird::PathName&);
#endif
bool ISC_analyze_protocol(const char*, Firebird::PathName&, Firebird::PathName&, const char*, bool needFile);
bool ISC_analyze_tcp(Firebird::PathName&, Firebird::PathName&, bool = true);
bool ISC_check_if_remote(const Firebird::PathName&, bool);
iscProtocol ISC_extract_host(Firebird::PathName&, Firebird::PathName&, bool);

View File

@ -346,6 +346,47 @@ bool ISC_analyze_nfs(tstring& expanded_filename, tstring& node_name)
#endif
#if defined(WIN_NT)
bool ISC_analyze_pclan(tstring& expanded_name, tstring& node_name)
{
/**************************************
*
* I S C _ a n a l y z e _ p c l a n
*
**************************************
*
* Functional description
* Check a file name for a SMB mount point. If so,
* decompose into node name and remote file name.
*
**************************************/
ISC_expand_share(expanded_name);
if (expanded_name.length() < 2 ||
(expanded_name[0] != '\\' && expanded_name[0] != '/') ||
(expanded_name[1] != '\\' && expanded_name[1] != '/'))
{
return false;
}
const size p = expanded_name.find_first_of("\\/", 2);
if (p == npos)
return false;
if (Config::getRemoteFileOpenAbility())
{
if (expanded_name.find(':', p + 1) == npos)
return false;
}
node_name = expanded_name.substr(2, p - 2);
expanded_name.erase(0, p + 1);
return true;
}
#endif
bool ISC_analyze_protocol(const char* protocol, tstring& expanded_name, tstring& node_name,
const char* separator, bool need_file)
{
@ -403,57 +444,6 @@ bool ISC_analyze_protocol(const char* protocol, tstring& expanded_name, tstring&
}
#if defined(WIN_NT)
bool ISC_analyze_pclan(tstring& expanded_name, tstring& node_name)
{
/**************************************
*
* I S C _ a n a l y z e _ p c l a n
*
**************************************
*
* Functional description
* Analyze a filename for a named pipe node name on the front.
* If one is found, extract the node name, compute the residual
* file name, and return true. Otherwise return false.
*
**************************************/
node_name.erase();
if (expanded_name.length() < 2 ||
(expanded_name[0] != '\\' && expanded_name[0] != '/') ||
(expanded_name[1] != '\\' && expanded_name[1] != '/'))
{
return false;
}
const size p = expanded_name.find_first_of("\\/", 2);
if (p == npos)
return false;
if (Config::getRemoteFileOpenAbility())
{
if (expanded_name.find(':', p + 1) == npos)
return false;
}
node_name = "\\\\";
node_name += expanded_name.substr(2, p - 2);
// If this is a loopback, substitute "." for the host name. Otherwise,
// the CreateFile on the pipe will fail.
TEXT localhost[MAXHOSTLEN];
ISC_get_host(localhost, sizeof(localhost));
if (node_name.substr(2, npos) == localhost)
{
node_name.replace(2, npos, ".");
}
expanded_name.erase(0, p + 1);
return true;
}
#endif // WIN_NT
bool ISC_analyze_tcp(tstring& file_name, tstring& node_name, bool need_file)
{
/**************************************
@ -564,46 +554,22 @@ iscProtocol ISC_extract_host(Firebird::PathName& file_name,
// Always check for an explicit TCP node name
if (ISC_analyze_tcp(file_name, host_name))
{
return ISC_PROTOCOL_TCPIP;
}
#ifndef NO_NFS
if (implicit_flag)
{
// Check for a file on an NFS mounted device
// Check for a file on a network mount
if (ISC_analyze_nfs(file_name, host_name))
{
#ifdef WIN_NT
if (ISC_analyze_pclan(file_name, host_name))
return ISC_PROTOCOL_TCPIP;
}
}
#endif
#if defined(WIN_NT)
// Check for an explicit named pipe node name
if (ISC_analyze_pclan(file_name, host_name))
{
return ISC_PROTOCOL_WLAN;
}
if (implicit_flag)
{
// Check for a file on a shared drive. First try to expand
// the path. Then check the expanded path for a TCP or named pipe.
ISC_expand_share(file_name);
if (ISC_analyze_tcp(file_name, host_name))
{
#ifndef NO_NFS
if (ISC_analyze_nfs(file_name, host_name))
return ISC_PROTOCOL_TCPIP;
}
if (ISC_analyze_pclan(file_name, host_name))
{
return ISC_PROTOCOL_WLAN;
}
#endif
}
#endif // WIN_NT
return ISC_PROTOCOL_LOCAL;
}

View File

@ -61,9 +61,6 @@
/* message files DIR (PREFIX) */
#define FB_MSGDIR ""
/* Wnet pipe name */
#define FB_PIPE_NAME "interbas"
/* plugins DIR (PREFIX) */
#define FB_PLUGDIR ""

View File

@ -67,9 +67,6 @@
/* message files DIR (PREFIX) */
#define FB_MSGDIR ""
/* Wnet pipe name */
#define FB_PIPE_NAME "interbas"
/* plugins DIR (PREFIX) */
#define FB_PLUGDIR ""

View File

@ -61,9 +61,6 @@
/* message files DIR (PREFIX) */
#define FB_MSGDIR ""
/* Wnet pipe name */
#define FB_PIPE_NAME "interbas"
/* plugins DIR (PREFIX) */
#define FB_PLUGDIR ""

View File

@ -61,9 +61,6 @@
/* message files DIR (PREFIX) */
#define FB_MSGDIR ""
/* Wnet pipe name */
#define FB_PIPE_NAME "interbas"
/* plugins DIR (PREFIX) */
#define FB_PLUGDIR ""

View File

@ -160,8 +160,7 @@
<protocol-string> ::=
"TCPv4" |
"TCPv6" |
"XNET" |
"WNET" |
"XNET"
....
<plugin-string> ::=

View File

@ -94,9 +94,6 @@
/* log file name within log dir */
#define FB_LOGFILENAME "@FB_LOGFILENAME@"
/* Wnet pipe name */
#define FB_PIPE_NAME "@FB_PIPE_NAME@"
/* Installation path prefix */
#define FB_PREFIX "@FB_PREFIX@"

View File

@ -285,9 +285,6 @@
#define FB_SERVICE_NAME "gds_db"
#define FB_SERVICE_PORT 3050
/* Wnet pipe name */
#define FB_PIPE_NAME "interbas"
/* Xnet objects name */
#define FB_IPC_NAME "FIREBIRD"

View File

@ -17,8 +17,6 @@ set(remote_src
../auth/trusted/AuthSspi.cpp
)
add_src_win32(remote_src
os/win32/wnet.cpp
os/win32/wnet_proto.h
os/win32/xnet.cpp
os/win32/xnet.h
os/win32/xnet_proto.h

View File

@ -83,7 +83,6 @@
#if defined(WIN_NT)
#include "../common/isc_proto.h"
#include "../remote/os/win32/wnet_proto.h"
#include "../remote/os/win32/xnet_proto.h"
#endif
@ -97,15 +96,10 @@ const char* const PROTOCOL_INET4 = "inet4";
const char* const PROTOCOL_INET6 = "inet6";
#ifdef WIN_NT
const char* const PROTOCOL_WNET = "wnet";
const char* const PROTOCOL_XNET = "xnet";
const char* const WNET_SEPARATOR = "@";
const char* const WNET_LOCALHOST = "\\\\.";
#endif
const char* const INET_SEPARATOR = "/";
const char* const INET_LOCALHOST = "localhost";
@ -4726,13 +4720,11 @@ bool ResultSet::fetch(CheckStatusWrapper* status, void* buffer, P_FETCH operatio
( // Low in inventory
(statement->rsr_rows_pending <= statement->rsr_reorder_level) &&
(statement->rsr_msgs_waiting <= statement->rsr_reorder_level) &&
// not using named pipe on NT
// Pipelining causes both server & client to
// write at the same time. In named pipes, writes
// write at the same time. In XNET, writes
// block for the other end to read - and so when both
// attempt to write simultaneously, they end up
// waiting indefinitely for the other end to read
(port->port_type != rem_port::PIPE) &&
// waiting indefinitely for the other end to read.
(port->port_type != rem_port::XNET) &&
// We're fetching either forward or backward
(operation == fetch_next || operation == fetch_prior) &&
@ -5871,12 +5863,11 @@ void Request::receive(CheckStatusWrapper* status, int level, unsigned int msg_ty
(tail->rrq_rows_pending <= tail->rrq_reorder_level && // Low in inventory
tail->rrq_msgs_waiting <= tail->rrq_reorder_level &&
// Pipelining causes both server & client to
// write at the same time. In named pipes, writes
// write at the same time. In XNET, writes
// block for the other end to read - and so when both
// attempt to write simultaenously, they end up
// waiting indefinetly for the other end to read
(port->port_type != rem_port::PIPE) && // not named pipe on NT
(port->port_type != rem_port::XNET) && // not shared memory on NT
// waiting indefinetly for the other end to read.
(port->port_type != rem_port::XNET) &&
request->rrq_max_msg <= 1)))
{
// there's only one message type
@ -7295,20 +7286,6 @@ static rem_port* analyze(ClntAuthBlock& cBlock, PathName& attach_name, unsigned
#ifdef WIN_NT
if (ISC_analyze_protocol(PROTOCOL_XNET, attach_name, node_name, NULL, needFile))
port = XNET_analyze(&cBlock, attach_name, flags & ANALYZE_USER_VFY, cBlock.getConfig(), ref_db_name);
else if (ISC_analyze_protocol(PROTOCOL_WNET, attach_name, node_name, WNET_SEPARATOR, needFile) ||
ISC_analyze_pclan(attach_name, node_name))
{
if (node_name.isEmpty())
node_name = WNET_LOCALHOST;
else
{
ISC_unescape(node_name);
ISC_utf8ToSystem(node_name);
}
port = WNET_analyze(&cBlock, attach_name, node_name.c_str(), flags & ANALYZE_USER_VFY,
cBlock.getConfig(), ref_db_name);
}
else
#endif
@ -7341,15 +7318,13 @@ static rem_port* analyze(ClntAuthBlock& cBlock, PathName& attach_name, unsigned
if (!port)
{
PathName expanded_name = attach_name;
ISC_expand_share(expanded_name);
if (ISC_analyze_pclan(expanded_name, node_name))
{
ISC_unescape(node_name);
ISC_utf8ToSystem(node_name);
port = WNET_analyze(&cBlock, expanded_name, node_name.c_str(), flags & ANALYZE_USER_VFY,
cBlock.getConfig(), ref_db_name);
port = INET_analyze(&cBlock, expanded_name, node_name.c_str(), flags & ANALYZE_USER_VFY, pb,
cBlock.getConfig(), ref_db_name, cryptCb);
}
}
#endif
@ -7383,12 +7358,6 @@ static rem_port* analyze(ClntAuthBlock& cBlock, PathName& attach_name, unsigned
port = XNET_analyze(&cBlock, attach_name, flags & ANALYZE_USER_VFY,
cBlock.getConfig(), ref_db_name);
}
if (!port)
{
port = WNET_analyze(&cBlock, attach_name, WNET_LOCALHOST, flags & ANALYZE_USER_VFY,
cBlock.getConfig(), ref_db_name);
}
#endif
if (!port)
{
@ -7809,20 +7778,9 @@ static void disconnect( rem_port* port)
}
}
// BAND-AID:
// It seems as if we are disconnecting the port
// on both the server and client side. For now
// let the server handle this for named pipes
packet->p_operation = op_disconnect;
port->send(packet);
// 8-Aug-1997 M. Duquette
// R. Kumar
// M. Romanini
if (port->port_type != rem_port::PIPE)
{
packet->p_operation = op_disconnect;
port->send(packet);
}
REMOTE_free_packet(port, packet);
}

View File

@ -671,7 +671,7 @@ rem_port* INET_analyze(ClntAuthBlock* cBlock,
ISC_get_user(&buffer, &eff_uid, &eff_gid);
#ifdef WIN_NT
// WNET and XNET lowercase user names (as it's always case-insensitive in Windows)
// XNET lowercases user names (as it's always case-insensitive in Windows),
// so let's be consistent and use the same trick for INET as well
buffer.lower();
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,35 +0,0 @@
/*
* PROGRAM: JRD Remote Interface/Server
* MODULE: wnet_proto.h
* DESCRIPTION: Prototpe header file for wnet.cpp
*
* The contents of this file are subject to the Interbase Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy
* of the License at http://www.Inprise.com/IPL.html
*
* Software distributed under the License is distributed on an
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
* or implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code was created by Inprise Corporation
* and its predecessors. Portions created by Inprise Corporation are
* Copyright (C) Inprise Corporation.
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*/
#ifndef REMOTE_WNET_PROTO_H
#define REMOTE_WNET_PROTO_H
#include "../common/classes/fb_string.h"
rem_port* WNET_analyze(ClntAuthBlock*, const Firebird::PathName&, const TEXT*, bool,
Firebird::RefPtr<const Firebird::Config>*, const Firebird::PathName*);
rem_port* WNET_connect(const TEXT*, struct packet*, USHORT, Firebird::RefPtr<const Firebird::Config>*);
rem_port* WNET_reconnect(HANDLE);
#endif // REMOTE_WNET_PROTO_H

View File

@ -1042,7 +1042,6 @@ struct rem_port : public Firebird::GlobalStorage, public Firebird::RefCounted
enum rem_port_t {
INET, // Internet (TCP/IP)
PIPE, // Windows NT named pipe connection
XNET // Windows NT shared memory connection
} port_type;
enum state_t {

View File

@ -81,11 +81,10 @@ const USHORT SRVR_server = 1; // server
const USHORT SRVR_multi_client = 2; // multi-client server
const USHORT SRVR_debug = 4; // debug run
const USHORT SRVR_inet = 8; // Inet protocol
const USHORT SRVR_wnet = 16; // Wnet (named pipe) protocol (WinNT)
const USHORT SRVR_xnet = 32; // Xnet protocol (Win32)
const USHORT SRVR_non_service = 64; // not running as an NT service
const USHORT SRVR_high_priority = 128; // fork off server at high priority
const USHORT SRVR_thread_per_port = 256; // bind thread to a port
const USHORT SRVR_no_icon = 512; // tell the server not to show the icon
const USHORT SRVR_xnet = 16; // Xnet protocol (Win32)
const USHORT SRVR_non_service = 32; // not running as an NT service
const USHORT SRVR_high_priority = 64; // fork off server at high priority
const USHORT SRVR_thread_per_port = 128; // bind thread to a port
const USHORT SRVR_no_icon = 256; // tell the server not to show the icon
#endif /* REMOTE_REMOTE_DEF_H */

View File

@ -154,7 +154,7 @@ LRESULT CALLBACK GeneralPage(HWND hDlg, UINT unMsg, WPARAM wParam, LPARAM lParam
lstrcpy(szText, FB_VERSION);
SetDlgItemText(hDlg, IDC_STAT1, szText);
if (usServerFlags & (SRVR_inet | SRVR_wnet))
if (usServerFlags & SRVR_inet)
LoadString(hInstance, IDS_SERVERPROD_NAME, szText, sizeof(szText));
else
LoadString(hInstance, IDS_LOCALPROD_NAME, szText, sizeof(szText));
@ -241,14 +241,6 @@ static char* MakeVersionString(char* pchBuf, size_t nLen, USHORT usServerFlagMas
if (p < end)
*p++ = '\n';
}
if ((usServerFlagMask & SRVR_wnet) && end > p)
{
p += LoadString(hInstance, IDS_NP, p, end - p);
if (p < end)
*p++ = '\r';
if (p < end)
*p++ = '\n';
}
if ((usServerFlagMask & SRVR_xnet) && end > p)
{
p += LoadString(hInstance, IDS_IPC, p, end - p);

View File

@ -45,7 +45,6 @@ STRINGTABLE
BEGIN
IDS_TCP, "TCP/IP Client Support"
IDS_IPC, "Local Client Support"
IDS_NP, "NetBEUI Client Support"
IDS_SUPER, "Multithreaded Server"
IDS_SERVERPROD_NAME, "Firebird SQL Server for Windows"
IDS_LOCALPROD_NAME, "Local Firebird Server"

View File

@ -48,7 +48,6 @@ produced by Borland Resource Workshop
#define IDI_IBSVR 1007
#define IDS_TCP 11
#define IDS_NP 12
#define IDS_IPC 13
#define IDS_SUPER 14

View File

@ -103,7 +103,6 @@
#include "../remote/server/serve_proto.h"
#include "../remote/server/ReplServer.h"
#include "../remote/server/os/win32/window_proto.h"
#include "../remote/os/win32/wnet_proto.h"
#include "../remote/server/os/win32/window.rh"
#include "../remote/os/win32/xnet_proto.h"
#include "../yvalve/gds_proto.h"
@ -118,7 +117,6 @@
static THREAD_ENTRY_DECLARE inet_connect_wait_thread(THREAD_ENTRY_PARAM);
static THREAD_ENTRY_DECLARE wnet_connect_wait_thread(THREAD_ENTRY_PARAM);
static THREAD_ENTRY_DECLARE xnet_connect_wait_thread(THREAD_ENTRY_PARAM);
static THREAD_ENTRY_DECLARE start_connections_thread(THREAD_ENTRY_PARAM);
static THREAD_ENTRY_DECLARE process_connection_thread(THREAD_ENTRY_PARAM);
@ -129,7 +127,6 @@ static int wait_threads(const int reason, const int mask, void* arg);
static HINSTANCE hInst;
static TEXT protocol_inet[128];
static TEXT protocol_wnet[128];
static TEXT instance[MAXPATHLEN];
static USHORT server_flag = 0;
static bool server_shutdown = false;
@ -224,7 +221,6 @@ int WINAPI WinMain(HINSTANCE hThisInst, HINSTANCE /*hPrevInst*/, LPSTR lpszArgs,
SetProcessAffinityMask(GetCurrentProcess(), affinity);
protocol_inet[0] = 0;
protocol_wnet[0] = 0;
strcpy(instance, FB_DEFAULT_INSTANCE);
@ -295,8 +291,6 @@ int WINAPI WinMain(HINSTANCE hThisInst, HINSTANCE /*hPrevInst*/, LPSTR lpszArgs,
port = NULL;
}
}
else if (server_flag & SRVR_wnet)
port = WNET_reconnect(connection_handle);
else if (server_flag & SRVR_xnet)
port = XNET_reconnect((ULONG_PTR) connection_handle);
@ -428,56 +422,6 @@ static THREAD_ENTRY_DECLARE inet_connect_wait_thread(THREAD_ENTRY_PARAM)
}
static THREAD_ENTRY_DECLARE wnet_connect_wait_thread(THREAD_ENTRY_PARAM)
{
/**************************************
*
* w n e t _ c o n n e c t _ w a i t _ t h r e a d
*
**************************************
*
* Functional description
*
**************************************/
ThreadCounter counter;
while (!server_shutdown)
{
rem_port* port = NULL;
try
{
port = WNET_connect(protocol_wnet, NULL, server_flag, NULL);
}
catch (const Exception& ex)
{
SimpleStatusVector<> status_vector;
ex.stuffException(status_vector);
if (status_vector[1] == isc_net_server_shutdown)
break;
iscLogException("WNET_connect", ex);
}
if (port)
{
try
{
Thread::start(process_connection_thread, port, THREAD_medium);
}
catch (const Exception&)
{
gds__log("WNET: can't start worker thread, connection terminated");
port->disconnect(NULL, NULL);
}
}
}
return 0;
}
static THREAD_ENTRY_DECLARE xnet_connect_wait_thread(THREAD_ENTRY_PARAM)
{
/**************************************
@ -571,18 +515,6 @@ static THREAD_ENTRY_DECLARE start_connections_thread(THREAD_ENTRY_PARAM)
}
}
if (server_flag & SRVR_wnet)
{
try
{
Thread::start(wnet_connect_wait_thread, 0, THREAD_medium);
}
catch (const Exception& ex)
{
iscLogException("WNET: can't start listener thread", ex);
}
}
if (server_flag & SRVR_xnet)
{
try
@ -650,19 +582,10 @@ static HANDLE parse_args(LPCSTR lpszArgs, USHORT* pserver_flag)
if (*p)
{
TEXT buffer[32];
const char* end = buffer + sizeof(buffer) - 1;
char* pp = buffer;
while (*p && *p != ' ' && (pp - buffer < sizeof(buffer) - 1))
{
if (*p == '@')
{
p++;
*pp++ = '\0';
connection_handle = (HANDLE) _atoi64(buffer);
pp = buffer;
}
else
*pp++ = *p++;
}
while (*p && *p != ' ' && pp < end)
*pp++ = *p++;
*pp++ = '\0';
if (connection_handle == INVALID_HANDLE_VALUE)
@ -699,7 +622,7 @@ static HANDLE parse_args(LPCSTR lpszArgs, USHORT* pserver_flag)
*pserver_flag |= SRVR_no_icon;
break;
case 'P': // Specify a port or named pipe other than the default
case 'P': // Specify a port other than the default
while (*p && *p == ' ')
p++;
if (*p)
@ -708,23 +631,14 @@ static HANDLE parse_args(LPCSTR lpszArgs, USHORT* pserver_flag)
// in the future, hence I did generic code.
char* pi = protocol_inet;
const char* piend = protocol_inet + sizeof(protocol_inet) - 1;
char* pw = protocol_wnet;
const char* pwend = protocol_wnet + sizeof(protocol_wnet) - 1;
*pi++ = '/';
*pw++ = '\\';
*pw++ = '\\';
*pw++ = '.';
*pw++ = '@';
while (*p && *p != ' ')
{
if (pi < piend)
*pi++ = *p;
if (pw < pwend)
*pw++ = *p++;
}
*pi++ = '\0';
*pw++ = '\0';
}
break;
@ -766,10 +680,6 @@ static HANDLE parse_args(LPCSTR lpszArgs, USHORT* pserver_flag)
}
break;
case 'W':
*pserver_flag |= SRVR_wnet;
break;
case 'X':
*pserver_flag |= SRVR_xnet;
break;
@ -791,9 +701,8 @@ static HANDLE parse_args(LPCSTR lpszArgs, USHORT* pserver_flag)
}
}
if ((*pserver_flag & (SRVR_inet | SRVR_wnet | SRVR_xnet)) == 0)
if ((*pserver_flag & (SRVR_inet | SRVR_xnet)) == 0)
{
*pserver_flag |= SRVR_wnet;
*pserver_flag |= SRVR_inet;
*pserver_flag |= SRVR_xnet;
}

View File

@ -2536,7 +2536,7 @@ static void aux_request( rem_port* port, /*P_REQ* request,*/ PACKET* send)
return;
}
// This buffer is used by INET and WNET transports
// This buffer is used by INET transport
// to return the server identification string
UCHAR buffer[BUFFER_TINY];
send->p_resp.p_resp_data.cstr_address = buffer;
@ -2937,7 +2937,7 @@ void rem_port::disconnect(PACKET* sendL, PACKET* receiveL)
return;
}
// For WNET and XNET we should send dummy op_disconnect packet
// For XNET we should send dummy op_disconnect packet
// to wakeup async port handling events on client side.
// For INET it's not necessary because INET client's async port
// wakes up while server performs shutdown(socket) call on its async port.
@ -2946,7 +2946,7 @@ void rem_port::disconnect(PACKET* sendL, PACKET* receiveL)
PACKET *packet = &rdb->rdb_packet;
if (this->port_async)
{
if ((this->port_type == rem_port::XNET) || (this->port_type == rem_port::PIPE))
if (this->port_type == rem_port::XNET)
{
packet->p_operation = op_disconnect;
this->port_async->send(packet);

View File

@ -396,22 +396,12 @@ int gsec(Firebird::UtilSvc* uSvc)
const Firebird::string sqlRoleName(user_data->role.entered() ? user_data->role.get() : "");
Firebird::PathName serverName;
const bool useServices = !uSvc->isService();
switch (ISC_extract_host(databaseName, serverName, true))
{
case ISC_PROTOCOL_TCPIP:
if (ISC_extract_host(databaseName, serverName, true) == ISC_PROTOCOL_TCPIP)
serverName += ":";
break;
case ISC_PROTOCOL_WLAN:
serverName = "\\\\" + serverName + "\\";
break;
}
const bool useServices = !uSvc->isService();
if (!useServices)
{
serverName = "";
}
Firebird::LocalStatus s;
Firebird::CheckStatusWrapper statusWrapper(&s);

View File

@ -593,18 +593,13 @@ int gstat(Firebird::UtilSvc* uSvc)
const Firebird::PathName connName = fileName;
Firebird::PathName tempStr;
#ifdef WIN_NT
if (!ISC_analyze_pclan(fileName, tempStr))
#endif
if (!ISC_analyze_tcp(fileName, tempStr))
{
if (!ISC_analyze_tcp(fileName, tempStr))
{
#ifndef NO_NFS
if (!ISC_analyze_nfs(fileName, tempStr))
if (!ISC_analyze_nfs(fileName, tempStr))
#endif
{
fileName = connName;
}
{
fileName = connName;
}
}