mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Bug #20683237 BACKPORT 19817663 TO 5.1 and 5.5
Restrict when user table hashes can be viewed. Require SUPER privileges.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -4698,14 +4698,21 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user)
|
||||
global.append ('\'');
|
||||
if (acl_user->salt_len)
|
||||
{
|
||||
char passwd_buff[SCRAMBLED_PASSWORD_CHAR_LENGTH+1];
|
||||
if (acl_user->salt_len == SCRAMBLE_LENGTH)
|
||||
make_password_from_salt(passwd_buff, acl_user->salt);
|
||||
global.append(STRING_WITH_LEN(" IDENTIFIED BY PASSWORD"));
|
||||
if ((thd->security_ctx->master_access & SUPER_ACL) == SUPER_ACL)
|
||||
{
|
||||
char passwd_buff[SCRAMBLED_PASSWORD_CHAR_LENGTH+1];
|
||||
if (acl_user->salt_len == SCRAMBLE_LENGTH)
|
||||
make_password_from_salt(passwd_buff, acl_user->salt);
|
||||
else
|
||||
make_password_from_salt_323(passwd_buff, (ulong *) acl_user->salt);
|
||||
|
||||
global.append(" \'");
|
||||
global.append(passwd_buff);
|
||||
global.append('\'');
|
||||
}
|
||||
else
|
||||
make_password_from_salt_323(passwd_buff, (ulong *) acl_user->salt);
|
||||
global.append(STRING_WITH_LEN(" IDENTIFIED BY PASSWORD '"));
|
||||
global.append(passwd_buff);
|
||||
global.append('\'');
|
||||
global.append(" <secret>");
|
||||
}
|
||||
/* "show grants" SSL related stuff */
|
||||
if (acl_user->ssl_type == SSL_TYPE_ANY)
|
||||
|
Reference in New Issue
Block a user