hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1478113 - in /hadoop/common/branches/branch-1.2: ./ CHANGES.txt src/c++/task-controller/impl/configuration.c src/c++/task-controller/impl/configuration.h src/c++/task-controller/impl/main.c src/c++/task-controller/test/test-task-controller.c
Date Wed, 01 May 2013 17:43:29 GMT
Author: omalley
Date: Wed May  1 17:43:29 2013
New Revision: 1478113

URL: http://svn.apache.org/r1478113
Log:
MAPREDUCE-5202. Revert MAPREDUCE-4397 to improve LinuxTaskController security. (omalley)

Modified:
    hadoop/common/branches/branch-1.2/   (props changed)
    hadoop/common/branches/branch-1.2/CHANGES.txt   (contents, props changed)
    hadoop/common/branches/branch-1.2/src/c++/task-controller/impl/configuration.c
    hadoop/common/branches/branch-1.2/src/c++/task-controller/impl/configuration.h
    hadoop/common/branches/branch-1.2/src/c++/task-controller/impl/main.c
    hadoop/common/branches/branch-1.2/src/c++/task-controller/test/test-task-controller.c

Propchange: hadoop/common/branches/branch-1.2/
------------------------------------------------------------------------------
  Merged /hadoop/common/branches/branch-1.1:r1478102

Modified: hadoop/common/branches/branch-1.2/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.2/CHANGES.txt?rev=1478113&r1=1478112&r2=1478113&view=diff
==============================================================================
--- hadoop/common/branches/branch-1.2/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1.2/CHANGES.txt Wed May  1 17:43:29 2013
@@ -212,6 +212,8 @@ Release 1.2.0 - 2013.04.16
 
   BUG FIXES
 
+    MAPREDUCE-5202. Revert MAPREDUCE-4397 to improve LinuxTaskController security. (omalley)
+
     HADOOP-9467. Metrics2 record filter should check name as well as tags.
     (Ganeshan Iyler via llu)
 

Propchange: hadoop/common/branches/branch-1.2/CHANGES.txt
------------------------------------------------------------------------------
  Merged /hadoop/common/branches/branch-1.1/CHANGES.txt:r1478102

Modified: hadoop/common/branches/branch-1.2/src/c++/task-controller/impl/configuration.c
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.2/src/c%2B%2B/task-controller/impl/configuration.c?rev=1478113&r1=1478112&r2=1478113&view=diff
==============================================================================
--- hadoop/common/branches/branch-1.2/src/c++/task-controller/impl/configuration.c (original)
+++ hadoop/common/branches/branch-1.2/src/c++/task-controller/impl/configuration.c Wed May
 1 17:43:29 2013
@@ -88,29 +88,6 @@ static int is_only_root_writable(const c
 }
 
 /**
- * Get the full path of the configuration file.
- * Use $HADOOP_SECURITY_CONF_DIR for the configuration directory, and if
- * it's not set, use the default value in default_conf_dir.
- */
-void get_config_path(char* conf_file_path, int size,
-                     char* default_conf_dir,
-                     const char* conf_file_name) {
-  if (conf_file_name == NULL) {
-    fprintf(LOGFILE, "Null configuration filename passed in\n");
-    exit(INVALID_CONFIG_FILE);
-  }
-  char *orig_conf_dir = getenv("HADOOP_SECURITY_CONF_DIR");
-  if (orig_conf_dir == NULL) {
-    if (default_conf_dir == NULL) {
-      fprintf(LOGFILE, "Null default configuration directory passed in\n");
-      exit(INVALID_CONFIG_FILE);
-    }
-    orig_conf_dir = default_conf_dir;
-  }
-  snprintf(conf_file_path, size, "%s/%s", orig_conf_dir, conf_file_name);
-}
-
-/**
  * Ensure that the configuration file and all of the containing directories
  * are only writable by root. Otherwise, an attacker can change the 
  * configuration and potentially cause damage.

Modified: hadoop/common/branches/branch-1.2/src/c++/task-controller/impl/configuration.h
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.2/src/c%2B%2B/task-controller/impl/configuration.h?rev=1478113&r1=1478112&r2=1478113&view=diff
==============================================================================
--- hadoop/common/branches/branch-1.2/src/c++/task-controller/impl/configuration.h (original)
+++ hadoop/common/branches/branch-1.2/src/c++/task-controller/impl/configuration.h Wed May
 1 17:43:29 2013
@@ -17,15 +17,6 @@
  */
 
 /**
- * Get the full path of the configuration file.
- * Use $HADOOP_SECURITY_CONF_DIR for the configuration directory, and if
- * it's not set, use the default value in default_conf_dir.
- */
-void get_config_path(char* conf_file_path, int size,
-                     char* default_conf_dir,
-                     const char* conf_file_name);
-
-/**
  * Ensure that the configuration file and all of the containing directories
  * are only writable by root. Otherwise, an attacker can change the 
  * configuration and potentially cause damage.

Modified: hadoop/common/branches/branch-1.2/src/c++/task-controller/impl/main.c
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.2/src/c%2B%2B/task-controller/impl/main.c?rev=1478113&r1=1478112&r2=1478113&view=diff
==============================================================================
--- hadoop/common/branches/branch-1.2/src/c++/task-controller/impl/main.c (original)
+++ hadoop/common/branches/branch-1.2/src/c++/task-controller/impl/main.c Wed May  1 17:43:29
2013
@@ -80,11 +80,7 @@ int main(int argc, char **argv) {
   #error HADOOP_CONF_DIR must be defined
 #endif
 
-  char orig_conf_file[PATH_MAX + 1]; // realpath is limitted by PATH_MAX
-  orig_conf_file[PATH_MAX] = 0; // in case of snprintf error
-  get_config_path(orig_conf_file, PATH_MAX + 1,
-                  STRINGIFY(HADOOP_CONF_DIR),
-                  CONF_FILENAME);
+  char *orig_conf_file = STRINGIFY(HADOOP_CONF_DIR) "/" CONF_FILENAME;
   char *conf_file = realpath(orig_conf_file, NULL);
 
   if (conf_file == NULL) {

Modified: hadoop/common/branches/branch-1.2/src/c++/task-controller/test/test-task-controller.c
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.2/src/c%2B%2B/task-controller/test/test-task-controller.c?rev=1478113&r1=1478112&r2=1478113&view=diff
==============================================================================
--- hadoop/common/branches/branch-1.2/src/c++/task-controller/test/test-task-controller.c
(original)
+++ hadoop/common/branches/branch-1.2/src/c++/task-controller/test/test-task-controller.c
Wed May  1 17:43:29 2013
@@ -281,27 +281,6 @@ void test_check_user() {
   }
 }
 
-void test_get_config_path() {
-  printf("\nTesting get_config_path\n");
-  char conf_file_1[PATH_MAX];
-  char conf_file_2[PATH_MAX];
-  get_config_path(conf_file_1, PATH_MAX, TEST_ROOT, "test.cfg");
-  char *conf_dir = getenv("HADOOP_SECURITY_CONF_DIR");
-  if (conf_dir == NULL) {
-    if (strcmp(conf_file_1, TEST_ROOT "/test.cfg") != 0) {
-      printf("FAIL: got wrong configuration file path\n");
-      exit(1);
-    }
-  }
-  else {
-    snprintf(conf_file_2, PATH_MAX, "%s/%s", conf_dir, "test.cfg");
-    if (strcmp(conf_file_1, conf_file_2) != 0) {
-      printf("FAIL: got wrong configuration file path\n");
-      exit(1);
-    }
-  }
-}
-
 void test_check_configuration_permissions() {
   printf("\nTesting check_configuration_permissions\n");
   if (check_configuration_permissions("/etc/passwd") != 0) {
@@ -843,8 +822,6 @@ int main(int argc, char **argv) {
   printf("\nTesting get_job_log_dir()\n");
   test_get_job_log_dir();
 
-  test_get_config_path();
-
   test_check_configuration_permissions();
 
   printf("\nTesting get_task_log_dir()\n");



Mime
View raw message