YARN-8384. stdout.txt, stderr.txt logs of a launched docker container is coming with primary group of submit user instead of hadoop. (Eric Yang via wangda)

Change-Id: Idbb2cd250f4f62dc32993e0d3ca3ec5684616baa
This commit is contained in:
Wangda Tan 2018-06-01 13:58:46 -07:00
parent cba3194998
commit 3a6bd77550

View File

@ -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;