From 0d19a0ce98053572447bdadf88687ec55f2f1f46 Mon Sep 17 00:00:00 2001 From: Colin Patrick Mccabe Date: Wed, 23 Mar 2016 11:19:18 -0700 Subject: [PATCH] HDFS-10193. fuse_dfs segfaults if uid cannot be resolved to a username (John Thiltges via cmccabe) --- .../src/main/native/fuse-dfs/fuse_connect.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/fuse-dfs/fuse_connect.c b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/fuse-dfs/fuse_connect.c index e696072d8c..6ee4ad5130 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/fuse-dfs/fuse_connect.c +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/fuse-dfs/fuse_connect.c @@ -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;