diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c index 7b622235bc..1b8842a01c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c @@ -1140,8 +1140,8 @@ char *init_log_path(const char *container_log_dir, const char *logfile) { int fd = open(tmp_buffer, O_CREAT | O_WRONLY, permissions); if (fd >= 0) { close(fd); - if (change_owner(tmp_buffer, user_detail->pw_uid, user_detail->pw_gid) != 0) { - fprintf(ERRORFILE, "Failed to chown %s to %d:%d: %s\n", tmp_buffer, user_detail->pw_uid, user_detail->pw_gid, + if (change_owner(tmp_buffer, user_detail->pw_uid, nm_gid) != 0) { + fprintf(ERRORFILE, "Failed to chown %s to %d:%d: %s\n", tmp_buffer, user_detail->pw_uid, nm_gid, strerror(errno)); free(tmp_buffer); tmp_buffer = NULL;