summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorSinisa@sinisa.nasamreza.org <>2004-03-01 21:54:08 +0200
committerSinisa@sinisa.nasamreza.org <>2004-03-01 21:54:08 +0200
commit7f3771bc769a6538ab00aa63d056e9cded4e32b4 (patch)
tree71c56bd3d5139f19b8dffae10cb503af66535c4d /sql/sql_acl.cc
parent9f11123f75c9738f11c6904b2a75e2627b9a3930 (diff)
downloadmariadb-git-7f3771bc769a6538ab00aa63d056e9cded4e32b4.tar.gz
fix for a bug #2953.
When password was granted with a global grant, then granting privileges on database level, without password being specified, will temporary (in memory) set password to ''.
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 58a6de5e4fc..59a96e28d77 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -829,8 +829,8 @@ static void acl_update_user(const char *user, const char *host,
acl_user->x509_subject= (x509_subject ?
strdup_root(&mem,x509_subject) : 0);
}
-
- set_user_salt(acl_user, password, password_len);
+ if (password)
+ set_user_salt(acl_user, password, password_len);
/* search complete: */
break;
}
@@ -1456,6 +1456,11 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
store_record(table,record[1]); // Save copy for update
if (combo.password.str) // If password given
table->field[2]->store(password, password_len, &my_charset_latin1);
+ else if (!rights && !revoke_grant && thd->lex->ssl_type == SSL_TYPE_NOT_SPECIFIED &&
+ !thd->lex->mqh.bits)
+ {
+ DBUG_RETURN(0);
+ }
}
/* Update table columns with new privileges */