~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/client.c

  • Committer: Brian Aker
  • Date: 2008-07-15 09:43:34 UTC
  • mfrom: (154.1.3 mysqladmin_diet)
  • Revision ID: brian@tangent.org-20080715094334-ctc02tojgpyy6u75
mysqladmin patch (plus removal of password auth bits)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1635
1635
  end= strend(end) + 1;
1636
1636
  if (passwd[0])
1637
1637
  {
1638
 
    if (mysql->server_capabilities & CLIENT_SECURE_CONNECTION)
1639
1638
    {
1640
1639
      *end++= SCRAMBLE_LENGTH;
1641
1640
      scramble(end, mysql->scramble, passwd);
1642
1641
      end+= SCRAMBLE_LENGTH;
1643
1642
    }
1644
 
    else
1645
 
    {
1646
 
      scramble_323(end, mysql->scramble, passwd);
1647
 
      end+= SCRAMBLE_LENGTH_323 + 1;
1648
 
    }
1649
1643
  }
1650
1644
  else
1651
1645
    *end++= '\0';                               /* empty password */
1682
1676
    goto error;
1683
1677
  }
1684
1678
 
1685
 
  if (pkt_length == 1 && net->read_pos[0] == 254 && 
1686
 
      mysql->server_capabilities & CLIENT_SECURE_CONNECTION)
1687
 
  {
1688
 
    /*
1689
 
      By sending this very specific reply server asks us to send scrambled
1690
 
      password in old format.
1691
 
    */
1692
 
    scramble_323(buff, mysql->scramble, passwd);
1693
 
    if (my_net_write(net, (uchar*) buff, SCRAMBLE_LENGTH_323 + 1) ||
1694
 
        net_flush(net))
1695
 
    {
1696
 
      set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
1697
 
                               ER(CR_SERVER_LOST_EXTENDED),
1698
 
                               "sending password information",
1699
 
                               errno);
1700
 
      goto error;
1701
 
    }
1702
 
    /* Read what server thinks about out new auth message report */
1703
 
    if (cli_safe_read(mysql) == packet_error)
1704
 
    {
1705
 
      if (mysql->net.last_errno == CR_SERVER_LOST)
1706
 
        set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
1707
 
                                 ER(CR_SERVER_LOST_EXTENDED),
1708
 
                                 "reading final connect information",
1709
 
                                 errno);
1710
 
      goto error;
1711
 
    }
1712
 
  }
1713
 
 
1714
1679
  if (client_flag & CLIENT_COMPRESS)            /* We will use compression */
1715
1680
    net->compress=1;
1716
1681