← Back to team overview

maria-developers team mailing list archive

Re: [Commits] cae1945: MDEV-9117: Client Server capability negotiation for MariaDB specific functionality

 

Hi, Oleksandr!

On Jan 17, Oleksandr Byelkin wrote:
> >>>> diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
> >>>> index 1240d5d..d07e0a4 100644
> >>>> --- a/sql/sql_acl.cc
> >>>> +++ b/sql/sql_acl.cc
> >>>> @@ -11729,18 +11731,38 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
> >>>> +    if (!(client_capabilities & CLIENT_MYSQL))
> >>>> +    {
> >>>> +      // it is client with mariadb extensions
> >>>> +      client_capabilities|= CLIENT_MYSQL;
> > Wait, why is this?
> Jast to return it "as it was" if you think that it is not needed then I 
> remove it.

What do you mean "return"? To whom?
I don't see why you may need to pretend that this is MySQL client, when
it is not.

> >>>> +      ulonglong ext_client_capabilities=
> >>>> +        (((ulonglong)uint4korr(net->read_pos + 28)) << 32);
> >>>> +      if (ext_client_capabilities & MARIADB_CLIENT_EXTENDED_FLAGS)
> >>>> +        client_capabilities|= ext_client_capabilities;
> >>>> +      else
> >>>> +      {
> >>>> +        DBUG_PRINT("error", ("CLIENT_PROTOCOL_41: on, "
> >>>> +                             "CLIENT_LONG_PASSWORD/CLIENT_MYSQL off, "
> >>>> +                             "but MARIADB_CLIENT_EXTENDED_FLAGS is off. "
> >>>> +                             "flags: %llx ext flags %llx",
> >>>> +                             client_capabilities, ext_client_capabilities));
> >>>> +        return packet_error;
> >>> Why do you need that (MARIADB_CLIENT_EXTENDED_FLAGS and the check)?
> >> Server read or do not read more flags depend on it.
> > But !(client_capabilities & CLIENT_MYSQL) already tells you that.
> > It's a MariaDB client = it has extended flags.
> As you saw it was not.

No, I did't. What do you mean "it was not"?

Regards,
Sergei
Chief Architect MariaDB
and security@xxxxxxxxxxx
-- 
Vote for my Percona Live 2016 talks:
https://www.percona.com/live/data-performance-conference-2016/sessions/mariadb-connectors-fast-and-smart-new-protocol-optimizations#community-voting
https://www.percona.com/live/data-performance-conference-2016/sessions/mariadb-101-security-validation-authentication-encryption#community-voting


Follow ups

References