소스 검색

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

Colin Patrick Mccabe 9 년 전
부모
커밋
0d19a0ce98
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/fuse-dfs/fuse_connect.c

+ 5 - 0
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;