diff options
Diffstat (limited to 'libmysqld')
-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 |