Prechádzať zdrojové kódy

MAPREDUCE-2103. Additional changes to task-controller.c Contributed by Benoy Antony.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22@1346254 13f79535-47bb-0310-9956-ffa450edef68
Konstantin Shvachko 13 rokov pred
rodič
commit
ae185d6a81

+ 3 - 0
mapreduce/CHANGES.txt

@@ -56,6 +56,9 @@ Release 0.22.1 - Unreleased
     MAPREDUCE-2377. task-controller fails to parse configuration if it doesn't
     end in \n. (Todd Lipcon and Benoy Antony via shv)
 
+    MAPREDUCE-2103. Additional changes to task-controller.c
+    (Benoy Antony via shv)
+
 Release 0.22.0 - 2011-11-29
 
   INCOMPATIBLE CHANGES

+ 7 - 7
mapreduce/src/c++/task-controller/impl/task-controller.c

@@ -97,8 +97,8 @@ char* get_executable() {
  * promisable. For this, we need task-controller binary to
  *    * be user-owned by root
  *    * be group-owned by a configured special group.
- *    * others do not have any permissions
- *    * be setuid/setgid
+ *    * others do not have write/execute permissions
+ *    * be setuid
  */
 int check_taskcontroller_permissions(char *executable_file) {
 
@@ -135,16 +135,16 @@ int check_taskcontroller_permissions(char *executable_file) {
     return -1;
   }
 
-  // check others do not have read/write/execute permissions
-  if ((filestat.st_mode & S_IROTH) == S_IROTH || (filestat.st_mode & S_IWOTH)
-      == S_IWOTH || (filestat.st_mode & S_IXOTH) == S_IXOTH) {
+  // check others do not have write/execute permissions
+  if ((filestat.st_mode & S_IWOTH) == S_IWOTH || 
+      (filestat.st_mode & S_IXOTH) == S_IXOTH) {
     fprintf(LOGFILE,
-            "The task-controller binary should not have read or write or"
+            "The task-controller binary should not have write or"
             " execute for others.\n");
     return -1;
   }
 
-  // Binary should be setuid/setgid executable
+  // Binary should be setuid executable
   if ((filestat.st_mode & S_ISUID) == 0) {
     fprintf(LOGFILE, "The task-controller binary should be set setuid.\n");
     return -1;