Skip to content

Commit

Permalink
Hope the last fix of nbackup host case insensitive cutting. Sorry.
Browse files Browse the repository at this point in the history
  • Loading branch information
romansimakov committed Dec 6, 2013
1 parent 2c8a258 commit 366a58e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/utilities/nbackup/nbackup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,12 @@ class NBackup
// Recognition of local prefix allows to work with
// database using TCP/IP loopback while reading file locally.
// RS: Maybe check if host is loopback via OS functions is more correct
PathName db(_database), host;
if (ISC_extract_host(db, host, false) == ISC_PROTOCOL_TCPIP)
PathName db(_database), host_port;
if (ISC_extract_host(db, host_port, false) == ISC_PROTOCOL_TCPIP)
{
if (!host.substr(0, sizeof(localhost) -1).equalsNoCase(localhost))
const PathName host = host_port.substr(0, sizeof(localhost) - 1);
const char delim = host_port.length() >= sizeof(localhost) ? host_port[sizeof(localhost) - 1] : '/';
if ((delim != '/') || !host.equalsNoCase(localhost))
pr_error(status, "nbackup needs local access to database file");
}

Expand Down

0 comments on commit 366a58e

Please sign in to comment.