~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.cc

  • Committer: Brian Aker
  • Date: 2010-02-14 02:02:48 UTC
  • mfrom: (1273.13.64 fix_is)
  • Revision ID: brian@gaz-20100214020248-bhovaejhz9fmer3q
MergeĀ inĀ data_dictionary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <drizzled/session.h>
26
26
#include "drizzled/session_list.h"
27
27
#include <sys/stat.h>
28
 
#include "drizzled/my_error.h"
29
28
#include <drizzled/error.h>
30
29
#include <drizzled/gettext.h>
31
30
#include <drizzled/query_id.h>
392
391
    if (global_system_variables.log_warnings)
393
392
        errmsg_printf(ERRMSG_LVL_WARN, ER(ER_FORCING_CLOSE),internal::my_progname,
394
393
                      thread_id,
395
 
                      (security_ctx.user.c_str() ?
396
 
                       security_ctx.user.c_str() : ""));
 
394
                      (getSecurityContext().getUser().c_str() ?
 
395
                       getSecurityContext().getUser().c_str() : ""));
397
396
    disconnect(0, false);
398
397
  }
399
398
 
678
677
 
679
678
  if (passwd_len != 0 && passwd_len != SCRAMBLE_LENGTH)
680
679
  {
681
 
    my_error(ER_HANDSHAKE_ERROR, MYF(0), security_ctx.ip.c_str());
 
680
    my_error(ER_HANDSHAKE_ERROR, MYF(0), getSecurityContext().getIp().c_str());
682
681
    return false;
683
682
  }
684
683
 
687
686
  if (is_authenticated != true)
688
687
  {
689
688
    my_error(ER_ACCESS_DENIED_ERROR, MYF(0),
690
 
             security_ctx.user.c_str(),
691
 
             security_ctx.ip.c_str(),
 
689
             getSecurityContext().getUser().c_str(),
 
690
             getSecurityContext().getIp().c_str(),
692
691
             passwd_len ? ER(ER_YES) : ER(ER_NO));
693
692
 
694
693
    return false;
695
694
  }
696
695
 
697
 
  security_ctx.skip_grants();
698
 
 
699
696
  /* Change database if necessary */
700
697
  if (in_db && in_db[0])
701
698
  {
1597
1594
  quick_group= 1;
1598
1595
  table_charset= 0;
1599
1596
  precomputed_group_by= 0;
1600
 
  bit_fields_as_long= 0;
1601
1597
}
1602
1598
 
1603
1599
void Tmp_Table_Param::cleanup(void)
1622
1618
  memset(&status_var, 0, sizeof(status_var));
1623
1619
}
1624
1620
 
1625
 
void Security_context::skip_grants()
1626
 
{
1627
 
  /* privileges for the user are unknown everything is allowed */
1628
 
}
1629
 
 
1630
1621
 
1631
1622
/****************************************************************************
1632
1623
  Handling of open and locked tables states.
1740
1731
  {
1741
1732
    if (! killed && variables.log_warnings > 1)
1742
1733
    {
1743
 
      Security_context *sctx= &security_ctx;
 
1734
      SecurityContext *sctx= &security_ctx;
1744
1735
 
1745
1736
      errmsg_printf(ERRMSG_LVL_WARN, ER(ER_NEW_ABORTING_CONNECTION)
1746
1737
                  , thread_id
1747
1738
                  , (db.empty() ? "unconnected" : db.c_str())
1748
 
                  , sctx->user.empty() == false ? sctx->user.c_str() : "unauthenticated"
1749
 
                  , sctx->ip.c_str()
 
1739
                  , sctx->getUser().empty() == false ? sctx->getUser().c_str() : "unauthenticated"
 
1740
                  , sctx->getIp().c_str()
1750
1741
                  , (main_da.is_error() ? main_da.message() : ER(ER_UNKNOWN_ERROR)));
1751
1742
    }
1752
1743
  }