diff options
author | Vicențiu Ciorbaru <cvicentiu@gmail.com> | 2013-10-17 20:39:23 -0700 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-10-17 20:39:23 -0700 |
commit | db25d8f97713e3a4ade8284c57f65c63605c5b25 (patch) | |
tree | 1520135c114dcd1c576384dd45d6e787de5e0e63 /sql/set_var.cc | |
parent | 494f0117995bcd786e481960d2c4cdd5d13f0f61 (diff) | |
download | mariadb-git-db25d8f97713e3a4ade8284c57f65c63605c5b25.tar.gz |
Modified set_role_var to implement both a role check in the check() function,
as well as only set privileges in the update() function.
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r-- | sql/set_var.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc index d09e2bcac77..33c360ae785 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -876,14 +876,20 @@ int set_var_password::update(THD *thd) *****************************************************************************/ int set_var_role::check(THD *thd) { - /* nothing to check */ +#ifndef NO_EMBEDDED_ACCESS_CHECKS + ulonglong access; + int status= acl_check_setrole(thd, base.str, &access); + save_result.ulonglong_value= access; + return status; +#else return 0; +#endif } int set_var_role::update(THD *thd) { #ifndef NO_EMBEDDED_ACCESS_CHECKS - return acl_setrole(thd, this->role.str); + return acl_setrole(thd, base.str, save_result.ulonglong_value); #else return 0; #endif |