HDFS-10193. fuse_dfs segfaults if uid cannot be resolved to a username (John Thiltges via cmccabe)
(cherry picked from commit 0d19a0ce98
)
This commit is contained in:
parent
76602161c0
commit
7ad3162df4
|
@ -570,6 +570,11 @@ int fuseConnectAsThreadUid(struct hdfsConn **conn)
|
||||||
|
|
||||||
ctx = fuse_get_context();
|
ctx = fuse_get_context();
|
||||||
usrname = getUsername(ctx->uid);
|
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);
|
ret = fuseConnect(usrname, ctx, conn);
|
||||||
free(usrname);
|
free(usrname);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue