Database Articles
  Home arrow Database Articles arrow Page 2 - Authentication Protocol Security
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Download TestComplete 
Forums Sitemap 
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DATABASE ARTICLES

Authentication Protocol Security
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 2
    2007-08-17

    Table of Contents:
  • Authentication Protocol Security
  • Authenticating Handshake
  • Command Packet
  • Server Responses
  • OK Packet
  • Error Packet
  • Result Set Packets

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Authentication Protocol Security - Authenticating Handshake


    (Page 2 of 7 )

    Table 4-5. Protocol capability bits (continued)

    Bit macro symbol

    Hex value

    Description

    CLIENT_LONG_FLAG

    0x0004

    This flag will be set for all modern clients. Some old clients expect to receive only 1 byte of flags in the field definition record, while the newer ones expect 2 bytes. If this flag is cleared, the client is old and wants only 1 byte for field flags. This flag will also be set by the modern server to indicate that it is capable of sending the field definition in the new format with 2 bytes for field flags. Old servers (pre-3.23) will not report having this capability.

    CLIENT_CONNECT_WITH_DB

    0x0008

    This flag is also set for all modern clients and servers. It indicates that the initial default database can be specified during authentication.

    CLIENT_NO_SCHEMA

    0x0010

    If set, the client is asking the server to consider the syntax db_name.table_name.col_name an error. This syntax is normally accepted.

    CLIENT_COMPRESS

    0x0020

    When set, indicates that the client or the server is capable of using hte compressed protocol.

    CLIENT_ODBC

    0x0040

    Apparently was created to indicate that the client is an ODBC client. At this point, it does not appear to be used.

    CLIENT_LOCAL_FILES

    0x0080

    When set, indicates that the client is capable of uploading local files with LOAD DATA LOCALINFILE.

    CLIENT_IGNORE_SPACE

    0x0100

    When set, communicates to the server that the parser should ignore the space characters between identifiers and subsequent ‘.’ or ‘(’ characters. This flag enables syntax such as: db_name .table_name or length (str) which would normally be illegal.

    CLIENT_PROTOCOL_41

    0x0200

    When set, indicates that the client or the server is capable of using the new protocol that was introduced in version 4.1.

    CLIENT_INTERACTIVE

    0x0400

    When set, the client is communicating to the server that it is accepting commands directly from a human. For the server, this means that a different inactivity timeout value should be applied. The server has two settings: wait_timout and interactive_timeout. The former is for regular clients, while the latter is for the interactive ones. This distinction was created to deal with applications using buggy persistent connection pools that would lose track of established connections without closing them first, keep creating new ones, and eventually overflow the server max_connectionslimit. The workaround was to set wait_timeoutto a low value that would disconnect the lost connections sooner. This, unfortunately, had a side effect of disconnecting interactive clients too soon, which was solved by giving them a separate timeout.

    Table 4-5. Protocol capability bits (continued)

    Bit macro symbol

    Hex value

    Description

    CLIENT_SSL

    0x0800

    When set, indicates the capability of the client or the server to use SSL.

    CLIENT_IGNORE_SIGPIPE

    0x1000

    Used internally in the client code in versions 3.23 and 4.0. SIGPIPEis a Unix signal sent to a process when the socket or the pipe it is writing to has already been closed by the peer. However, a thread in a threaded application on some platforms may get a SIGPIPEsignal spuriously under some circumstances. Versions 3.23 and 4.0 permit the client pro-grammer to choose whether SIGPIPEshould be ignored. Version 4.1 just blocks it during the client initialization and does not worry about the issue from that point on.

    CLIENT_TRANSACTIONS

    0x2000

    When set in the packet coming from the server, indicates that the server supports transactions and is capable of report-ing transaction status. When present in the client packet, indicates that the client is aware of servers that support transactions.

    CLIENT_RESERVED

    0x4000

    Not used.

    CLIENT_SECURE_CONNECTION

    0x8000

    When set, indicates that the client or the server can authenti-cate using the new SHA1 method introduced in 4.1.

    CLIENT_MULTI_STATEMENTS

    0x10000

    When set, indicates that the client can send more than one statement in one query, for example: res = mysql_query(con,"SELECT a FROM t1 WHERE id =1; SELECT b FROM t1 WHERE id=3");

    CLIENT_MULTI_RESULTS

    0x20000

    When set, indicates that the client can receive results from multiple queries in the same statement.

    CLIENT_REMEMBER_OPTIONS

    0x80000000

    Internal flag used inside the client routines. Never sent to the server.

    More Database Articles Articles
    More By O'Reilly Media


     

    Buy this book now. This article is excerpted from the book Understanding MySQL Internals, written by Sasha Pachev (O'Reilly, 2007; ISBN: 0596009577). Check it out today at your favorite bookstore. Buy this book now.

    DATABASE ARTICLES ARTICLES

    - More on Query Optimization for Oracle Databa...
    - Query Optimization in Oracle
    - Clusters and Other Data Structures for Oracle
    - Using Indexes with an Oracle Database
    - The Basics of Data Structures in Oracle
    - Oracle Data Structures
    - Best Practices for PL/SQL Variables
    - What`s Code Without Variables?
    - Clauses, Sorting, and SQL Queries
    - The From Clause and SQL Queries
    - Query Primer
    - Full Text Searches and Strings
    - Searching with Strings
    - Pattern Matching with Strings
    - Working with Cases of Strings





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek