List:Internals« Previous MessageNext Message »
From:Salil Arun Bhagurkar Date:September 10 2011 6:24pm
Subject:check_access() returns FALSE for internal access granted
View as plain text  
if ((db != NULL) && (db != any_db))
  {
    const ACL_internal_schema_access *access;
    access= get_cached_schema_access(grant_internal_info, db);
    if (access)
    {
      switch (access->check(want_access, save_priv))
      {
      case ACL_INTERNAL_ACCESS_GRANTED:
        /*
          All the privileges requested have been granted internally.
          [out] *save_privileges= Internal privileges.
        */
        DBUG_RETURN(FALSE);
      case ACL_INTERNAL_ACCESS_DENIED:
        if (! no_errors)
        {
          my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
                   sctx->priv_user, sctx->priv_host, db);
        }
        DBUG_RETURN(TRUE);

In the above code snippet from check_access() in sql_parse.cc, the code returns FALSE
when ACL_INTERNAL_ACCESS_GRANTED is returned by access->check(). Does this mean that
the access is really granted, or is some logical inversion implied here that I'm missing
out?

Cheers,
Salil Bhagurkar
Thread
check_access() returns FALSE for internal access grantedSalil Arun Bhagurkar10 Sep
  • Re: check_access() returns FALSE for internal access grantedSergei Golubchik12 Sep