Repository: hadoop Updated Branches: refs/heads/branch-2.8 762c7d436 -> 4ca13e7b9
HDFS-10193. fuse_dfs segfaults if uid cannot be resolved to a username (John Thiltges via cmccabe) (cherry picked from commit 0d19a0ce98053572447bdadf88687ec55f2f1f46) (cherry picked from commit 7ad3162df421ee1104c90de08235af467d08e76b) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/4ca13e7b Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/4ca13e7b Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/4ca13e7b Branch: refs/heads/branch-2.8 Commit: 4ca13e7b9892be7e5a21a18b3dde7001a994975e Parents: 762c7d4 Author: Colin Patrick Mccabe <cmcc...@cloudera.com> Authored: Wed Mar 23 11:19:18 2016 -0700 Committer: Colin Patrick Mccabe <cmcc...@cloudera.com> Committed: Wed Mar 23 11:20:12 2016 -0700 ---------------------------------------------------------------------- .../src/main/native/fuse-dfs/fuse_connect.c | 5 +++++ 1 file changed, 5 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/4ca13e7b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/fuse-dfs/fuse_connect.c ---------------------------------------------------------------------- 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 e696072..6ee4ad5 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;