Return-Path: X-Original-To: apmail-hadoop-mapreduce-commits-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DD774C7FF for ; Tue, 5 Jun 2012 02:44:14 +0000 (UTC) Received: (qmail 98740 invoked by uid 500); 5 Jun 2012 02:44:14 -0000 Delivered-To: apmail-hadoop-mapreduce-commits-archive@hadoop.apache.org Received: (qmail 98577 invoked by uid 500); 5 Jun 2012 02:44:14 -0000 Mailing-List: contact mapreduce-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mapreduce-dev@hadoop.apache.org Delivered-To: mailing list mapreduce-commits@hadoop.apache.org Received: (qmail 98565 invoked by uid 99); 5 Jun 2012 02:44:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jun 2012 02:44:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jun 2012 02:44:12 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 0B128238897A; Tue, 5 Jun 2012 02:43:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1346216 - in /hadoop/common/branches/branch-0.22/mapreduce: CHANGES.txt src/c++/task-controller/impl/task-controller.c Date: Tue, 05 Jun 2012 02:43:50 -0000 To: mapreduce-commits@hadoop.apache.org From: shv@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120605024351.0B128238897A@eris.apache.org> Author: shv Date: Tue Jun 5 02:43:50 2012 New Revision: 1346216 URL: http://svn.apache.org/viewvc?rev=1346216&view=rev Log: MAPREDUCE-4244. Set supplemental groups correctly. Contributed by Benoy Antony. Modified: hadoop/common/branches/branch-0.22/mapreduce/CHANGES.txt hadoop/common/branches/branch-0.22/mapreduce/src/c++/task-controller/impl/task-controller.c Modified: hadoop/common/branches/branch-0.22/mapreduce/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.22/mapreduce/CHANGES.txt?rev=1346216&r1=1346215&r2=1346216&view=diff ============================================================================== --- hadoop/common/branches/branch-0.22/mapreduce/CHANGES.txt (original) +++ hadoop/common/branches/branch-0.22/mapreduce/CHANGES.txt Tue Jun 5 02:43:50 2012 @@ -39,6 +39,8 @@ Release 0.22.1 - Unreleased MAPREDUCE-2178. Race condition in LinuxTaskController permissions handling. (Todd Lipcon, Benoy Antony via shv) + MAPREDUCE-4244. Set supplemental groups correctly. (Benoy Antony via shv) + Release 0.22.0 - 2011-11-29 INCOMPATIBLE CHANGES Modified: hadoop/common/branches/branch-0.22/mapreduce/src/c++/task-controller/impl/task-controller.c URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.22/mapreduce/src/c%2B%2B/task-controller/impl/task-controller.c?rev=1346216&r1=1346215&r2=1346216&view=diff ============================================================================== --- hadoop/common/branches/branch-0.22/mapreduce/src/c++/task-controller/impl/task-controller.c (original) +++ hadoop/common/branches/branch-0.22/mapreduce/src/c++/task-controller/impl/task-controller.c Tue Jun 5 02:43:50 2012 @@ -490,6 +490,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); }