hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sj...@apache.org
Subject [02/50] [abbrv] hadoop git commit: Reverted due to issue YARN-5765. Revert "YARN-5287. LinuxContainerExecutor fails to set proper permission. Contributed by Ying Zhang"
Date Tue, 22 Nov 2016 21:33:19 GMT
Reverted due to issue YARN-5765. Revert "YARN-5287. LinuxContainerExecutor fails to set proper
permission. Contributed by Ying Zhang"

This reverts commit 131d58a24edcf3b492a7dd0fa5bb3dbf27daf95d.

server-nodemanager/src/main/native/container-executor/test/test-
container-executor.c


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/43aef303
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/43aef303
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/43aef303

Branch: refs/heads/HADOOP-13070
Commit: 43aef303bf9b71293b00c7ed6e8807d15274ca95
Parents: b7070f3
Author: Naganarasimha <naganarasimha_gr@apache.org>
Authored: Tue Nov 15 13:27:37 2016 +0530
Committer: Naganarasimha <naganarasimha_gr@apache.org>
Committed: Tue Nov 15 13:27:37 2016 +0530

----------------------------------------------------------------------
 .../impl/container-executor.c                   | 11 +-----
 .../impl/container-executor.h                   | 10 -----
 .../test/test-container-executor.c              | 41 --------------------
 3 files changed, 1 insertion(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/43aef303/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c
----------------------------------------------------------------------
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 8a995b1..25f01ea 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
@@ -615,15 +615,6 @@ int create_validate_dir(const char* npath, mode_t perm, const char* path,
       if (check_dir(npath, sb.st_mode, perm, finalComponent) == -1) {
         return -1;
       }
-    } else {
-      // Explicitly set permission after creating the directory in case
-      // umask has been set to a restrictive value, i.e., 0077.
-      if (chmod(npath, perm) != 0) {
-        int permInt = perm & (S_IRWXU | S_IRWXG | S_IRWXO);
-        fprintf(LOGFILE, "Can't chmod %s to the required permission %o - %s\n",
-                npath, permInt, strerror(errno));
-        return -1;
-      }
     }
   } else {
     if (check_dir(npath, sb.st_mode, perm, finalComponent) == -1) {
@@ -654,7 +645,7 @@ int check_dir(const char* npath, mode_t st_mode, mode_t desired, int finalCompon
  * Function to prepare the container directories.
  * It creates the container work and log directories.
  */
-int create_container_directories(const char* user, const char *app_id,
+static int create_container_directories(const char* user, const char *app_id,
     const char *container_id, char* const* local_dir, char* const* log_dir, const char *work_dir)
{
   // create dirs as 0750
   const mode_t perms = S_IRWXU | S_IRGRP | S_IXGRP;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/43aef303/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.h
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.h
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.h
index 8ad5d47..aa1c4a1 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.h
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.h
@@ -297,13 +297,3 @@ int is_docker_support_enabled();
  * Run a docker command passing the command file as an argument
  */
 int run_docker(const char *command_file);
-
-/**
- * Function to prepare the container directories.
- * It creates the container work and log directories.
- */
-int create_container_directories(const char* user, const char *app_id,
-                     const char *container_id, char* const* local_dir,
-                     char* const* log_dir, const char *work_dir);
-
-int create_log_dirs(const char *app_id, char * const * log_dirs);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/43aef303/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/test/test-container-executor.c
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/test/test-container-executor.c
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/test/test-container-executor.c
index 0c9e496..0968b35 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/test/test-container-executor.c
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/test/test-container-executor.c
@@ -1013,43 +1013,6 @@ void test_recursive_unlink_children() {
   }
 }
 
-/**
- * This test is used to verify that app and container directories can be
- * created with required permissions when umask has been set to a restrictive
- * value of 077.
- */
-void test_dir_permissions() {
-  printf("\nTesting dir permissions\n");
-
-  // Set umask to 077
-  umask(077);
-
-  // Change user to the yarn user. This only takes effect when we're
-  // running as root.
-  if (seteuid(user_detail->pw_uid) != 0) {
-    printf("FAIL: failed to seteuid to user - %s\n", strerror(errno));
-    exit(1);
-  }
-
-  // Create container directories for "app_5"
-  char* container_dir = get_container_work_directory(TEST_ROOT "/local-1",
-                                     yarn_username, "app_5", "container_1");
-  create_log_dirs("app_5", log_dirs);
-  create_container_directories(yarn_username, "app_5", "container_1",
-                               local_dirs, log_dirs, container_dir);
-
-  // Verify directories have been created with required permissions
-  mode_t container_dir_perm = S_IRWXU | S_IRGRP | S_IXGRP;
-  struct stat sb;
-  if (stat(container_dir, &sb) != 0 ||
-      check_dir(container_dir, sb.st_mode, container_dir_perm, 1) != 0) {
-    printf("FAIL: failed to create container directory %s "
-           "with required permissions\n", container_dir);
-    exit(1);
-  }
-
-  free(container_dir);
-}
 
 /**
  * This test is used to verify that trim() works correctly
@@ -1253,10 +1216,6 @@ int main(int argc, char **argv) {
     test_run_container();
   }
 
-  // This test needs to be run in a subshell, so that when it changes umask
-  // and user, it doesn't give up our privs.
-  run_test_in_child("test_dir_permissions", test_dir_permissions);
-
   /*
    * try to seteuid(0).  if it doesn't work, carry on anyway.
    * we're going to capture the return value to get rid of a 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message