问题
What does DPB mean in Firebird, and how to use isc_dpb_trusted_auth
parameter?
回答1:
What does DPB mean in Firebird
Most probably it is "Database Parameter Buffer", and there is TPB for "Transaction...." and SPB for "Service ..." (used in Services API).
And Firebird 2.1.7 bugslist has the following quote:
The engine was incorrectly populating integer containers in the blob parameter buffer (BPB)
I think those abbreviations were conceived more than 30 years ago, when the database today known as Firebird was being developed as proposed new component of VAX VMS operating system.
You may go Firebird-developers maillist and ask how current developers guess what DPB stand for. Or you may try to find mr. Starkey and mrs. Harrison and ask if they still remember what they meant more than 30 years ago.
how to use isc_dpb_trusted_auth parameter
This is described in two sources that I can see. And both use the same words.
- https://firebirdsql.org/rlsnotesh/rnfb210-wintrusted.html
- c:\Program Files\Firebird\Firebird_2_1\doc\README.trusted_authentication.txt
To keep legacy behavior when ISC_USER/ISC_PASSWORD variables are set in environment, they are picked and used instead of trusted authentication. In case when trusted authentication is needed and ISC_USER/ISC_PASSWORD are set, add new DPB parameter isc_dpb_trusted_auth to DPB.
It seems it does not matter which value the parameter has, it only sometime matters whether it is present or not.
To connect the database you call Firebird function isc_attach_database
. This function takes 6 parameters. #5 is the length of DPB binary block and #6 is the pointer to DPB binary block.
Example of building of binary DPB block you can find in the sources of your library of choice that you use to connect to firebird server.
For example with Unified Interbase library you can start exploring examples\UIB\API\
projects. They all use calls like
UL.AttachDatabase(new_dbname, newdb, 'user_name = SYSDBA; password = masterkey');
The last string being the parameter list. For trusted aithenticaton to work, according to the documentation quoted above, you have to remove user_name
and password
parameters and optionally you may add trusted_auth
parameter with any value. Then you can trace it down to the function CreateDBParams
, which creates the DPB binary representation out of your text key-value list string.
PS. would you try to compile those examples - do not forget to configure UIB library to use Firebird 2.1 or higher API by enabling FB21
option in uib.inc
file.
来源:https://stackoverflow.com/questions/44301189/what-is-dpb-mean-for-in-firebird-and-how-to-use-isc-dpb-trusted-auth-parameter