diff options
author | unknown <Sinisa@sinisa.nasamreza.org> | 2002-06-25 21:20:10 +0300 |
---|---|---|
committer | unknown <Sinisa@sinisa.nasamreza.org> | 2002-06-25 21:20:10 +0300 |
commit | fa27ad9025069fefe946399bc911df7d33d50139 (patch) | |
tree | f4a378e5c4a12d1d735ff95e378a82f208cbb5cb /sql/sql_acl.cc | |
parent | 337ab0c6ecbcd06ded02a30029357c1caa7e00a0 (diff) | |
download | mariadb-git-fa27ad9025069fefe946399bc911df7d33d50139.tar.gz |
Fix for a user management system that resources can be reset to zero
with a GRANT statement.
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index cdfe2f2e5b3..aff6c206b28 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -652,11 +652,11 @@ static void acl_update_user(const char *user, const char *host, acl_user->host.hostname && !strcmp(host,acl_user->host.hostname)) { acl_user->access=privileges; - if (mqh->questions) + if (mqh->bits & 1) acl_user->user_resource.questions=mqh->questions; - if (mqh->updates) + if (mqh->bits & 2) acl_user->user_resource.updates=mqh->updates; - if (mqh->connections) + if (mqh->bits & 4) acl_user->user_resource.connections=mqh->connections; #ifdef HAVE_OPENSSL acl_user->ssl_type=ssl_type; @@ -1300,11 +1300,11 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, #endif /* HAVE_OPENSSL */ USER_RESOURCES mqh = thd->lex.mqh; - if (mqh.questions) + if (mqh.bits & 1) table->field[28]->store((longlong) mqh.questions); - if (mqh.updates) + if (mqh.bits & 2) table->field[29]->store((longlong) mqh.updates); - if (mqh.connections) + if (mqh.bits & 4) table->field[30]->store((longlong) mqh.connections); mqh_used = mqh_used || mqh.questions || mqh.updates || mqh.connections; } |