summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-11-02 13:44:07 +0100
committerSergei Golubchik <serg@mariadb.org>2016-11-02 13:44:07 +0100
commita98c85bb501e9021c0d8d509b8c040611d4c0c3a (patch)
tree61dc69fc1cbf886aee6c2934e8efc6b57c3462bb /libmysql
parentc18054deb2b5cfcf1f13aa71574406f2bafb87c6 (diff)
parent7196691b44b65e12cb5cca6f17c8d0f091eb443f (diff)
downloadmariadb-git-a98c85bb501e9021c0d8d509b8c040611d4c0c3a.tar.gz
Merge branch '10.0-galera' into 10.1
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/libmysql.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 190652c1d61..4d7d8a380a7 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -452,8 +452,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