Re: [Firebird-devel] C++11 features

2016-09-01 Thread Roman Simakov
I guess atomic also must be very helpful.

2016-09-01 20:37 GMT+03:00 Adriano dos Santos Fernandes :
> On 01/09/2016 13:41, Dmitry Yemanov wrote:
>> + nullptr and static_assert, maybe also initializer lists and non-static
>> member initializers.
>>
> And override too, which can be easily defined for nothing when not
> supported (HP aCC) and is a very good tool specially when refactoring code.
>
>
> Adriano
>
>
> --
> Firebird-Devel mailing list, web interface at 
> https://lists.sourceforge.net/lists/listinfo/firebird-devel



-- 
С уважением
Роман Симаков
Директор департамента развития системных продуктов
ООО "Ред Софт"

skype: simakov_roman
www.red-soft.ru

--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] C++11 features

2016-09-01 Thread Adriano dos Santos Fernandes
On 01/09/2016 13:41, Dmitry Yemanov wrote:
> + nullptr and static_assert, maybe also initializer lists and non-static 
> member initializers.
>
And override too, which can be easily defined for nothing when not
supported (HP aCC) and is a very good tool specially when refactoring code.


Adriano


--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] C++11 features

2016-09-01 Thread Dmitry Yemanov
01.09.2016 15:46, Adriano dos Santos Fernandes wrote:
>
> I see that before VC++ 2015 Update 3, it accepts everything supported
> without compiler options, right?

Looks so.

> So, I think the plan should be:
>
> - Update Linux prefix files to include -std=c++11
> - Agree on a set of allowed features
> - Write a readme specifying these features
>
> I can then submit it as PR with some usage of these features, converted
> from old code, so others can see it working in their environments.

Agreed.

> For the set of allowed features, I would want we to be dynamic and
> always evaluate then as necessary, but I would start with:
>
> - auto keyword
> - range-based for loop
> - lambdas

+ nullptr and static_assert, maybe also initializer lists and non-static 
member initializers.


Dmitry


--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] isc_dpb_trusted_auth in FB3

2016-09-01 Thread Alex Peshkoff
On 09/01/2016 05:40 PM, Jiří Činčura wrote:
> Nice, nailed it.
>
> Another question. For Srp I send the auth data as a HEX string in UTF8
> bytes (and that works), while in Sspi the auth data is sent (at least
> only that works) as bytes directly. In both cases in
> isc_dpb_specific_auth_data.
>
> Srp: byte[] -> HEX string -> UTF8 byte[] -> isc_dpb_specific_auth_data
> Sspi: byte[] -> isc_dpb_specific_auth_data
>
> That doesn't seem right to me.

SSPI is used for windows only, and the data sent is exactly what windows 
recommends.

With Srp I've chosen hex form due to the following reason. (BTW I can't 
imagine difference for hex string between utf8 and plain ascii). Tommath 
library keeps bigintegers in some internal form not known to outer 
world. It may be exported/imported in text string using various radix 
(from 2 to 50) or in internal binary form. That binary form is 
definitely more compact - but what happens with it on machines with 
different endianess? Or what will happen if another biginteger 
implementation will be used instead tommath in some client? On the other 
hand text with radix representation does not depend upon both issues and 
radix == 16 is expected to be supported by any reasonable big integer 
packet.

Returning to SSPI - it's not expected to have different endianess 
(windows runs on intels) and moreover different implementations. 
Therefore no such problems with it.
> But it's the combination that works. Am I
> doing it right?
>

Yes.


--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] isc_dpb_trusted_auth in FB3

2016-09-01 Thread Jiří Činčura
Nice, nailed it. 

Another question. For Srp I send the auth data as a HEX string in UTF8
bytes (and that works), while in Sspi the auth data is sent (at least
only that works) as bytes directly. In both cases in
isc_dpb_specific_auth_data.

Srp: byte[] -> HEX string -> UTF8 byte[] -> isc_dpb_specific_auth_data
Sspi: byte[] -> isc_dpb_specific_auth_data

That doesn't seem right to me. But it's the combination that works. Am I
doing it right?

-- 
Mgr. Jiří Činčura
Independent IT Specialist

--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] isc_dpb_trusted_auth in FB3

2016-09-01 Thread Alex Peshkoff
On 09/01/2016 04:54 PM, Jiří Činčura wrote:
> So where the client auth data should be sent? And which tag?
>

client auth data may be sent:
1. In op_connect, in user_id, tag CNCT_specific_data, together with CNCT_login, 
CNCT_plugin_name and CNCT_plugin_list (used first time).
2. In DPB, tag isc_dpb_specific_data, when not sent in op_connect plugin_name 
and plugin_list should be also sent (used second time when possible).
3. In op_cont_auth packet, field p_auth_cont (used after methods 1 and 2 up to 
the end of auth process).




--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] isc_dpb_trusted_auth in FB3

2016-09-01 Thread Jiří Činčura
So where the client auth data should be sent? And which tag?

--
Mgr. Jiří Činčura
Independent IT Specialist


On Thu, Sep 1, 2016, at 14:57, Alex Peshkoff wrote:
> On 09/01/2016 01:39 PM, Jiří Činčura wrote:
> > Looks like I moved somewhere. In op_connect+op_accept I send as
> > plugin
> > Win_Sspi and I send the client token. Then I get back response as
> > op_accept_data, there I find the auth data from server and I can use
> > there to create client authentication data.
> >
> > In protocol <13 this was sent to server using op_trusted_auth.
> > But looks
> > like that's no longer the case. I tried sending using
> > isc_dpb_specific_auth_data, as in Srp, but that's not giving me
> > what I
> > expect. I get either "Your user name and password are not
> > defined. Ask
> > your database administrator to set up a Firebird login." or
> > "unavailable
> > database" depending on what magic I'm doing, while isql (or
> > protocol 12)
> > gives me expected "Login name too long (33 characters, maximum
> > allowed
> > 31)".
> >
> > Can anybody explain what should happen after op_accept_data in
> > protocol
> > 13 with SSPI? Something right there or later in op_attach.
> >
>
> No matter of what plugin is used op_accept_data in addition to
> op_accept
> may (or may not) contain name(s) of a key(s) that may be used for data
> encryption. Particular for SSPI which does not provide encryption keys
> op_accept_data does not differ from op_accept.
>
>
>
>
> --
> 
> Firebird-Devel mailing list, web interface at
> https://lists.sourceforge.net/lists/listinfo/firebird-devel
--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] isc_dpb_trusted_auth in FB3

2016-09-01 Thread Alex Peshkoff
On 09/01/2016 01:39 PM, Jiří Činčura wrote:
> Looks like I moved somewhere. In op_connect+op_accept I send as plugin
> Win_Sspi and I send the client token. Then I get back response as
> op_accept_data, there I find the auth data from server and I can use
> there to create client authentication data.
>
> In protocol <13 this was sent to server using op_trusted_auth. But looks
> like that's no longer the case. I tried sending using
> isc_dpb_specific_auth_data, as in Srp, but that's not giving me what I
> expect. I get either "Your user name and password are not defined. Ask
> your database administrator to set up a Firebird login." or "unavailable
> database" depending on what magic I'm doing, while isql (or protocol 12)
> gives me expected "Login name too long (33 characters, maximum allowed
> 31)".
>
> Can anybody explain what should happen after op_accept_data in protocol
> 13 with SSPI? Something right there or later in op_attach.
>

No matter of what plugin is used op_accept_data in addition to op_accept 
may (or may not) contain name(s) of a key(s) that may be used for data 
encryption. Particular for SSPI which does not provide encryption keys 
op_accept_data does not differ from op_accept.




--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] C++11 features

2016-09-01 Thread Adriano dos Santos Fernandes
On 01/09/2016 09:25, Dmitry Yemanov wrote:
> 01.09.2016 14:04, Adriano dos Santos Fernandes wrote:
>> MSVC10 supports nothing, and even MSVC12 is also a bit limited in regard
>> to MSVC14 and recent g++ and clang++:
>>
>> https://msdn.microsoft.com/en-us/library/hh567368.aspx
> We've agreed on MSVC13 for FBv4, so we cannot use features from later 
> versions. As for gcc, are there officially supported Linux distros other 
> than CentOS 6 that use gcc 4.7 or older? RHEL6 is EOL now, fortunately.
>
I see that before VC++ 2015 Update 3, it accepts everything supported
without compiler options, right?

So, I think the plan should be:

- Update Linux prefix files to include -std=c++11
- Agree on a set of allowed features
- Write a readme specifying these features

I can then submit it as PR with some usage of these features, converted
from old code, so others can see it working in their environments.

For the set of allowed features, I would want we to be dynamic and
always evaluate then as necessary, but I would start with:

- auto keyword
- range-based for loop
- lambdas


Adriano


--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] [FB-Tracker] Created: (CORE-5344) Error when "Execute Statement ... on external data source" done under trusted authentication without "As user ... PASSWORD ... ROLE .." parameters

2016-09-01 Thread ded Rasta (JIRA)
Error when "Execute Statement ... on external data source" done under trusted 
authentication without "As user ... PASSWORD ... ROLE .." parameters
--

 Key: CORE-5344
 URL: http://tracker.firebirdsql.org/browse/CORE-5344
 Project: Firebird Core
  Issue Type: Bug
  Components: API / Client Library
Affects Versions: 3.0.1
 Environment: Windows (client and server),Firebird-3.0.1.32573-0_x64
Reporter: ded Rasta
Priority: Minor


Connect with database as trusted user ( current_user = 'domain\user' ) and 
execute following code: 

execute block
returns (  p01 timestamp )
AS
declare variable s varchar(2000);
begin
  S = 'select current_timestamp from rdb$database';
  execute statement (:S)
--  as user 'SYSDBA'
--  password 'masterkey'
  on external data source 'inet4://LOCALHOST:3052/EMPLOYEE_FB3'
  into :p01;
  suspend;
end

Got following error: 

Unsuccessful execution caused by system error that does not preclude successful 
execution of subsequent statements.
Internal error when using clumplet API: attempt to store 268 bytes in a 
clumplet with maximum size 255 bytes.

When uncommenting user and password parameters code executes without error

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] C++11 features

2016-09-01 Thread Dmitry Yemanov
01.09.2016 14:04, Adriano dos Santos Fernandes wrote:
>
> MSVC10 supports nothing, and even MSVC12 is also a bit limited in regard
> to MSVC14 and recent g++ and clang++:
>
> https://msdn.microsoft.com/en-us/library/hh567368.aspx

We've agreed on MSVC13 for FBv4, so we cannot use features from later 
versions. As for gcc, are there officially supported Linux distros other 
than CentOS 6 that use gcc 4.7 or older? RHEL6 is EOL now, fortunately.


Dmitry


--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] C++11 features

2016-09-01 Thread Adriano dos Santos Fernandes
On 31/08/2016 04:54, Dmitry Yemanov wrote:
> 31.08.2016 05:14, Adriano dos Santos Fernandes wrote:
>> In the code I'm writing, I had good opportunities to use some features
>> that the compiler flags we're using disallowed, like lambda and default
>> arguments for template parameter.
>>
>> Also we have the ubiquitous ugly iterator types in for's with would
>> benefit from "auto".
>>
>> It seems we already had some discussion of usage of some of these
>> features, but builds are not adjusted.
>>
>> The obsolete language standard we're using is so boring and so outdated.
>> We need to move on.
> Basically, I agree. IIRC, a showstopper is MSVC10 support which I'd 
> prefer to keep for a while. But if others don't consider it really 
> important, I'm not going to stop the progress ;-)
>
>
I'm afraid that if we do not peek only very fresh versions of the main
compilers, we can do nothing then, as when joining the feature matrix
nothing will be allowed.

MSVC10 supports nothing, and even MSVC12 is also a bit limited in regard
to MSVC14 and recent g++ and clang++:

https://msdn.microsoft.com/en-us/library/hh567368.aspx


Adriano


--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] isc_dpb_trusted_auth in FB3

2016-09-01 Thread Jiří Činčura
Looks like I moved somewhere. In op_connect+op_accept I send as plugin
Win_Sspi and I send the client token. Then I get back response as
op_accept_data, there I find the auth data from server and I can use
there to create client authentication data. 

In protocol <13 this was sent to server using op_trusted_auth. But looks
like that's no longer the case. I tried sending using
isc_dpb_specific_auth_data, as in Srp, but that's not giving me what I
expect. I get either "Your user name and password are not defined. Ask
your database administrator to set up a Firebird login." or "unavailable
database" depending on what magic I'm doing, while isql (or protocol 12)
gives me expected "Login name too long (33 characters, maximum allowed
31)".

Can anybody explain what should happen after op_accept_data in protocol
13 with SSPI? Something right there or later in op_attach.

-- 
Mgr. Jiří Činčura
Independent IT Specialist

--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] isc_dpb_trusted_auth in FB3

2016-09-01 Thread Jiří Činčura
Hi *,

was there any change in FB3 of how the isc_dpb_trusted_auth is handled?
In FB2.5 I get as a response op_trusted_auth with bunch of bytes to
initialize SSPI context. But on FB3 the response is op_cont_auth.

I suppose the isc_dpb_trusted_auth is done differently on FB3. Can
somebody give me some overview?

-- 
Mgr. Jiří Činčura
Independent IT Specialist

--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] C++11 features

2016-09-01 Thread Paul Beach
>As I was said, it would drop out some platforms such as HPUX and Solaris
> where compilers don't support C++11 standard.

>> Are these platforms that significant anymore for Firebird?

Still used (and maintained) by some customers (and IBPhoenix) on 2.5 

> Are there more than 1000 Firebird deployments on them?

HPUX 2.0.3 Classic 2,737 + 3,247 = 5984 Downloads
HPUX 2.1.4 Classic 93 + 113 = 206 Downloads

Solaris (Sparc) Classic 2.0.5 2,305 Downloads
Solaris (Sparc) Classic 2.1.3 793 Downloads

So the trend does seem to be away from such platforms.
If Companies like HP, Oracle, IBM, are not producing current compilers that 
support
such standards, then as you say - its time to move on.

Paul

--
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel