Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legacy_Auth plugin does not connect from FB3 to FB2.5 server when tried after Win_Sspi [CORE4471] #4791

Closed
firebird-automations opened this issue Jun 23, 2014 · 20 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @sim1984

Is duplicated by CORE4649

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

Commits: 7006c82 FirebirdSQL/fbt-repository@06657a8

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @sim1984

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

What build of FB3 do you use?
Did you look at CORE4395 ?

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>

@firebird-automations
Copy link
Collaborator Author

Commented by: @sim1984

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.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @sim1984

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

In that case that's definitely not related with plugins.

@firebird-automations
Copy link
Collaborator Author

Commented by: @sim1984

I get it. The problem is that the EXECUTE STATEMENT does not understand the connection string indicating the port. But why only Legacy_Auth

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @sim1984

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @sim1984

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>

@firebird-automations
Copy link
Collaborator Author

Commented by: @sim1984

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Yes, this looks like a bug. I've updated a ticket and will fix it.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

description: 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 connected via SRP. Of course, you can change the authentication method, but it will change immediately for the entire database. As I understand MAPPING can solve the inverse problem (connect to Firebird 2.5 Firebird 3.0), but not the one that I described. Maybe expand the operator EXECUTE STATEMENT so that it is possible to specify authorization plugin?

EXECUTE STATEMENT {<sql_statement_string> |: <SQL_STMT_VARIABLE>} [(<input_parameters>)]
      [ON EXTERNAL [DATA SOURCE] <connection_string>]
      [WITH {AUTONOMOUS | COMMON} TRANSACTION]
      [USE PLUGIN <plugin_name>]
      [AS USER <user_name> [PASSWORD <password>]]
      [WITH CALLER PRIVILEGES]

=>

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

summary: Allow to specify plugin authorization statement EXECUTE STATEMENT => Legacy_Auth plugin does not connect from FB3 to FB2.5 server when tried after Win_Sspi

@firebird-automations
Copy link
Collaborator Author

Modified by: @sim1984

issuetype: Improvement [ 4 ] => Bug [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Client was incorrectly choosing authentication plugin.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 Beta 2 [ 10586 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

Link: This issue is duplicated by CORE4649 [ CORE4649 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants