HDFS-10193. fuse_dfs segfaults if uid cannot be resolved to a username (John Thiltges via cmccabe)

(cherry picked from commit 0d19a0ce98)
(cherry picked from commit 7ad3162df4)
This commit is contained in:
Colin Patrick Mccabe 2016-03-23 11:19:18 -07:00
parent 762c7d4361
commit 4ca13e7b98
1 changed files with 5 additions and 0 deletions

View File

@ -570,6 +570,11 @@ int fuseConnectAsThreadUid(struct hdfsConn **conn)
ctx = fuse_get_context();
usrname = getUsername(ctx->uid);
if (!usrname) {
ERROR("fuseConnectAsThreadUid(): failed to get username for uid %"PRId64
"\n", (uint64_t)ctx->uid);
return EIO;
}
ret = fuseConnect(usrname, ctx, conn);
free(usrname);
return ret;