hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravip...@apache.org
Subject hadoop git commit: YARN-1519. Check in container-executor if sysconf is implemented before using it (Radim Kolar and Eric Payne via raviprak)
Date Thu, 14 May 2015 22:56:46 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 fa082e1a0 -> 4caadaa8b


YARN-1519. Check in container-executor if sysconf is implemented before using it (Radim Kolar
and Eric Payne via raviprak)

(cherry picked from commit 53fe4eff09fdaeed75a8cad3a26156bf963a8d37)


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

Branch: refs/heads/branch-2
Commit: 4caadaa8bb61e6514c002a81b31bf4a649a685b5
Parents: fa082e1
Author: Ravi Prakash <raviprak@apache.org>
Authored: Thu May 14 15:55:37 2015 -0700
Committer: Ravi Prakash <raviprak@apache.org>
Committed: Thu May 14 15:56:36 2015 -0700

----------------------------------------------------------------------
 hadoop-yarn-project/CHANGES.txt                               | 3 +++
 .../main/native/container-executor/impl/container-executor.c  | 7 +++++--
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/4caadaa8/hadoop-yarn-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt
index c642b12..3ce0ab5 100644
--- a/hadoop-yarn-project/CHANGES.txt
+++ b/hadoop-yarn-project/CHANGES.txt
@@ -363,6 +363,9 @@ Release 2.8.0 - UNRELEASED
     YARN-2921. Fix MockRM/MockAM#waitForState sleep too long. 
     (Tsuyoshi Ozawa via wangda)
 
+    YARN-1519. Check in container-executor if sysconf is implemented before
+    using it (Radim Kolar and Eric Payne via raviprak)
+
 Release 2.7.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4caadaa8/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 6727838..962d52a 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
@@ -631,8 +631,11 @@ static int create_container_directories(const char* user, const char
*app_id,
  */
 static struct passwd* get_user_info(const char* user) {
   int string_size = sysconf(_SC_GETPW_R_SIZE_MAX);
-  void* buffer = malloc(string_size + sizeof(struct passwd));
   struct passwd *result = NULL;
+  if(string_size < 1024) {
+    string_size = 1024;
+  }
+  void* buffer = malloc(string_size + sizeof(struct passwd));
   if (getpwnam_r(user, buffer, buffer + sizeof(struct passwd), string_size,
 		 &result) != 0) {
     free(buffer);
@@ -1425,7 +1428,7 @@ void chown_dir_contents(const char *dir_path, uid_t uid, gid_t gid)
{
      
   dp = opendir(dir_path);
   if (dp != NULL) {
-    while (ep = readdir(dp)) {
+    while ((ep = readdir(dp)) != NULL) {
       stpncpy(buf, ep->d_name, strlen(ep->d_name));
       buf[strlen(ep->d_name)] = '\0';
       change_owner(path_tmp, uid, gid);


Mime
View raw message