Issue Details (XML | Word | Printable)

Key: CORE-4471
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Simonov Denis
Votes: 0
Watchers: 5
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Legacy_Auth plugin does not connect from FB3 to FB2.5 server when tried after Win_Sspi

Created: 23/Jun/14 09:48 AM   Updated: 18/Jan/16 03:30 PM
Component/s: Engine
Affects Version/s: None
Fix Version/s: 3.0 Beta 2

Issue Links:
Duplicate
 

QA Status: No test


 Description  « Hide
I have a problem with a bunch of 3 and Firebird Firebird 2.5 by operator EXECUTE STATEMENT.

"335544472: Your user name and password are not defined. Ask your database administrator to set up a Firebird login."

This occurs because the operator EXECUTE STATEMENT ON EXTERNAL DATA SOURCE

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Peshkov added a comment - 23/Jun/14 11:14 AM
Please explain - from what firebird version to what do you want to connect. Connection from 3.0 to 2.5 causes no problems, works with default .conf files and does not require additional options in EXECUTE STATEMENT. Connection from 2.5 to 3.0 will work only if you tune fb3 server to accept legacy auth.

Simonov Denis added a comment - 23/Jun/14 11:26 AM - edited
execute block
returns (i int)
as
begin
  for execute statement 'select 1 as a from rdb$database'
      on external 'server/3051:horses'
      as user 'sysdba'
      password 'qwerty'
      into :i
  do suspend;
end

FB3.0
Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements.
Execute statement error at attach :
335544472 : Your user name and password are not defined. Ask your database administrator to set up a Firebird login.
Data source : Firebird::server/3051:horses.

FB2.5
OK

firebird.conf don't change

databases.conf (FB3)

horses = d:\fb\fb30\data\horses.fdb {
TempBlockSize = 4M
TempCacheLimit = 512M
DefaultDbCachePages = 8K
}

If so "Connection from 3.0 to 2.5 causes no problems, works with default.conf files and does not require additional options in EXECUTE STATEMENT.", then one it might a bug. Probably occurs only on Windows.

Alexander Peshkov added a comment - 23/Jun/14 11:43 AM
What build of FB3 do you use?
Did you look at http://tracker.firebirdsql.org/browse/CORE-4395 ?

Currently everything works fine:
SQL> set term ^;
SQL> execute block
CON> returns (i int)
CON> as
CON> begin
CON> for execute statement 'select 1 as a from rdb$database'
CON> on external 'localhost:employee'
CON> as user 'sysdba'
CON> password 'masterkey'
CON> into :i
CON> do suspend;
CON> end^

           I
============
           1

SQL> show version^
ISQL Version: LI-T3.0.0.31184 Firebird 3.0 Alpha 2
Server version:
Firebird/Linux/AMD/Intel/x64 (access method), version "LI-T3.0.0.31184 Firebird 3.0 Alpha 2"
on disk structure version 12.0
SQL>

Simonov Denis added a comment - 23/Jun/14 11:52 AM
SQL> connect 'localhost:horses' user 'sysdba' password 'masterkey';
Database: 'localhost:horses', User: sysdba
SQL> show version;
ISQL Version: WI-T3.0.0.31190 Firebird 3.0 Alpha 2
Server version:
Firebird/Windows/AMD/Intel/x64 (access method), version "WI-T3.0.0.31190 Firebird 3.0 Alpha 2"
Firebird/Windows/AMD/Intel/x64 (remote server), version "WI-T3.0.0.31190 Firebird 3.0 Alpha 2/tcp (s
tation9)/P13:C"
Firebird/Windows/AMD/Intel/x64 (remote interface), version "WI-T3.0.0.31190 Firebird 3.0 Alpha 2/tcp
 (station9)/P13:C"
on disk structure version 12.0
SQL> set term ^;
SQL> execute block
CON> returns (i int)
CON> as
CON> begin
CON> for execute statement 'select 1 as a from rdb$database'
CON> on external 'server/3051:horses'
CON> as user 'sysdba'
CON> password 'qwerty'
CON> into :i
CON> do suspend;
CON> end^

           I
============
Statement failed, SQLSTATE = 42000
Execute statement error at attach :
335544472 : Your user name and password are not defined. Ask your database administrator to set up a
 Firebird login.
Data source : Firebird::server/3051:horses

May be due to the fact that I have Windows.

Simonov Denis added a comment - 23/Jun/14 12:16 PM - edited
This bug appears when you specify a non-standard port. If the port is a standard 3050 (connection string 'server:horses'), there is no problem.

Alexander Peshkov added a comment - 23/Jun/14 12:29 PM
In that case that's definitely not related with plugins.

Simonov Denis added a comment - 23/Jun/14 12:42 PM
I get it. The problem is that the EXECUTE STATEMENT does not understand the connection string indicating the port. But why only Legacy_Auth

Alexander Peshkov added a comment - 23/Jun/14 01:47 PM
Really strange. Does it mean that exec statement fb3->fb3 on non-default port works fine?
BTW, here we can expect some OS-specifics. Code, parsing connection string, is full of #ifdef SOME_OS lines.

Simonov Denis added a comment - 23/Jun/14 02:01 PM
Maybe not. I tried to connect to itself. Port have no standard.


execute block
returns (i int)
as
begin
  for execute statement 'select 1 as a from rdb$database'
      on external 'localhost/3051:horses'
      as user 'sysdba'
      password 'masterkey'
      into :i
  do suspend;
end

It's OK.

Simonov Denis added a comment - 23/Jun/14 07:16 PM - edited
It seems about the fact that I lied works. Slightly modify the query to return a version that connects to the server.
Firebird 2.5 on port 3050. Firebird 3.0 on port 3051

Use CONNECT or CREATE DATABASE to specify a database
SQL> connect 'localhost: horses' user 'sysdba' password 'masterkey';
Database: 'localhost: horses', User: sysdba
SQL> show version;
ISQL Version: WI-T3.0.0.31188 Firebird 3.0 Alpha 2
Server version:
Firebird/Windows/AMD/Intel/x64 (access method), version "WI-T3.0.0.31188 Firebird 3.0 Alpha 2"
Firebird/Windows/AMD/Intel/x64 (remote server), version "WI-T3.0.0.31188 Firebird 3.0 Alpha 2/tcp (Den-PC) / P13: C"
Firebird/Windows/AMD/Intel/x64 (remote interface), version "WI-T3.0.0.31188 Firebird 3.0 Alpha 2/tcp (Den-PC) / P13: C"
on disk structure version 12.0
SQL> set term ^;
SQL> execute block
CON> returns (i int)
CON> as
CON> begin
CON> for execute statement 'select mon$ods_major as a from mon$database'
CON> on external 'localhost:billing'
CON> as user 'sysdba'
CON> password 'masterkey'
CON> into :i
CON> do suspend;
CON> end ^

           I
============
          12

SQL> execute block
CON> returns (i int)
CON> as
CON> begin
CON> for execute statement 'select mon$ods_major as a from mon$database'
CON> on external 'localhost/3051:billing'
CON> as user 'sysdba'
CON> password 'masterkey'
CON> into :i
CON> do suspend;
CON> end ^

           I
============
          12


SQL> execute block
CON> returns (i int)
CON> as
CON> begin
CON> for execute statement 'select mon$ods_major as a from mon $ database'
CON> on external 'localhost/3050:billing'
CON> as user 'sysdba'
CON> password 'masterkey'
CON> into :i
CON> do suspend;
CON> end ^

           I
============
Statement failed, SQLSTATE = 42000
Execute statement error at attach:
335544472: Your user name and password are not defined. Ask your database administrator to set up a Firebird login.
Data source: Firebird::localhost/3050: billing
SQL>

Simonov Denis added a comment - 01/Jul/14 06:35 AM
I still managed to connect from the database Firebird 3 to Firebird 2.5, but changes in the configuration file firebird.conf still required.

#
# Per-connection and per-database configurable.
#
#AuthClient = Srp, Win_Sspi, Legacy_Auth
#
# If you need to use server plugins that do not provide encryption key (both Legacy_Auth
# & Win_Sspi) you should also turn off required encryption on the wire with WireCrypt
# configuration parameter except when working with never encrypted XNET protocol.
#
AuthClient = Srp, Legacy_Auth, Win_Sspi <-- This

If so it should be just close this ticket and make a note in the Release Notes. If not, then it is a bug. It is not clear why, if Win_Sspi could not connect, then Legacy_Auth even trying. Maybe due to the fact that the domain network is not configured.

Alexander Peshkov added a comment - 01/Jul/14 07:23 AM
Yes, this looks like a bug. I've updated a ticket and will fix it.

Alexander Peshkov added a comment - 03/Dec/14 02:49 PM
Client was incorrectly choosing authentication plugin.