hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r1311989 - /hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c
Date Tue, 10 Apr 2012 20:56:03 GMT
Author: bobby
Date: Tue Apr 10 20:56:02 2012
New Revision: 1311989

URL: http://svn.apache.org/viewvc?rev=1311989&view=rev
Log:
merge -r1301819:1301820 from trunk onto branch-0.23.

Modified:
    hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c

Modified: hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c?rev=1311989&r1=1311988&r2=1311989&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c
(original)
+++ hadoop/common/branches/branch-0.23/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/container-executor.c
Tue Apr 10 20:56:02 2012
@@ -526,6 +526,17 @@ int set_user(const char *user) {
   if (user_detail == NULL) {
     return -1;
   }
+
+  if (geteuid() == user_detail->pw_uid) {
+    return 0;
+  }
+
+  if (initgroups(user, user_detail->pw_gid) != 0) {
+    fprintf(LOGFILE, "Error setting supplementary groups for user %s: %s\n",
+        user, strerror(errno));
+    return -1;
+  }
+
   return change_effective_user(user_detail->pw_uid, user_detail->pw_gid);
 }
 



Mime
View raw message