diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-11-02 13:44:07 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-11-02 13:44:07 +0100 |
commit | a98c85bb501e9021c0d8d509b8c040611d4c0c3a (patch) | |
tree | 61dc69fc1cbf886aee6c2934e8efc6b57c3462bb /libmysql | |
parent | c18054deb2b5cfcf1f13aa71574406f2bafb87c6 (diff) | |
parent | 7196691b44b65e12cb5cca6f17c8d0f091eb443f (diff) | |
download | mariadb-git-a98c85bb501e9021c0d8d509b8c040611d4c0c3a.tar.gz |
Merge branch '10.0-galera' into 10.1
Diffstat (limited to 'libmysql')
-rw-r--r-- | libmysql/libmysql.c | 5 |
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 |