diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-12-29 13:23:18 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-12-29 13:23:18 +0100 |
commit | 4a5d25c338a5d1d2cc16343380193d6bf25ae6ae (patch) | |
tree | 73b84a9c8f3d5e3e3383fa79465b11f9ded512d3 /libmysqld/libmysql.c | |
parent | 48dc7cc66ef5b69fcf28ec0b2ecf0338c188cf4e (diff) | |
parent | c13b5011629b5ff7b969d648265002e4d1ba94c2 (diff) | |
download | mariadb-git-4a5d25c338a5d1d2cc16343380193d6bf25ae6ae.tar.gz |
Merge branch '10.1' into 10.2
Diffstat (limited to 'libmysqld/libmysql.c')
-rw-r--r-- | libmysqld/libmysql.c | 5 |
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 |