summaryrefslogtreecommitdiff
path: root/libmysqld/libmysql.c
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-12-29 13:23:18 +0100
committerSergei Golubchik <serg@mariadb.org>2016-12-29 13:23:18 +0100
commit4a5d25c338a5d1d2cc16343380193d6bf25ae6ae (patch)
tree73b84a9c8f3d5e3e3383fa79465b11f9ded512d3 /libmysqld/libmysql.c
parent48dc7cc66ef5b69fcf28ec0b2ecf0338c188cf4e (diff)
parentc13b5011629b5ff7b969d648265002e4d1ba94c2 (diff)
downloadmariadb-git-4a5d25c338a5d1d2cc16343380193d6bf25ae6ae.tar.gz
Merge branch '10.1' into 10.2
Diffstat (limited to 'libmysqld/libmysql.c')
-rw-r--r--libmysqld/libmysql.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libmysqld/libmysql.c b/libmysqld/libmysql.c
index 379a2d15fa0..7d36931dd1f 100644
--- a/libmysqld/libmysql.c
+++ b/libmysqld/libmysql.c
@@ -450,8 +450,9 @@ void read_user_name(char *name)
void read_user_name(char *name)
{
- char *str=getenv("USER"); /* ODBC will send user variable */
- strmake(name,str ? str : "ODBC", USERNAME_LENGTH);
+ DWORD len= USERNAME_LENGTH;
+ if (!GetUserName(name, &len))
+ strmov(name,"UNKNOWN_USER");
}
#endif