From 366adeab08308aa8431b1c2363cf02226a1ad6b9 Mon Sep 17 00:00:00 2001 From: Build Team Date: Mon, 10 Nov 2008 21:21:49 +0100 Subject: Added "Sun Microsystems, Inc." to copyright headers on files modified since Oct 1st --- sql/set_var.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/set_var.cc') diff --git a/sql/set_var.cc b/sql/set_var.cc index a62cafc3873..17585f17dfe 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. 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 -- cgit v1.2.1 From 026e9c36766ba81d728e189555b8a15f0d4c52ba Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Wed, 24 Dec 2008 19:14:59 +0400 Subject: Bug#41456 SET PASSWORD hates CURRENT_USER() init user->user struct with thd->security_ctx->priv_user context if user->user is not initializied --- sql/set_var.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sql/set_var.cc') diff --git a/sql/set_var.cc b/sql/set_var.cc index 59741e5683d..a29abe6581f 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -3475,6 +3475,7 @@ int set_var_password::check(THD *thd) #ifndef NO_EMBEDDED_ACCESS_CHECKS if (!user->host.str) { + DBUG_ASSERT(thd->security_ctx->priv_host); if (*thd->security_ctx->priv_host != 0) { user->host.str= (char *) thd->security_ctx->priv_host; @@ -3486,6 +3487,12 @@ int set_var_password::check(THD *thd) user->host.length= 1; } } + if (!user->user.str) + { + DBUG_ASSERT(thd->security_ctx->priv_user); + user->user.str= (char *) thd->security_ctx->priv_user; + user->user.length= strlen(thd->security_ctx->priv_user); + } /* Returns 1 as the function sends error to client */ return check_change_password(thd, user->host.str, user->user.str, password, strlen(password)) ? 1 : 0; -- cgit v1.2.1