You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by om...@apache.org on 2011/03/04 05:48:01 UTC

svn commit: r1077720 - /hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/pipes/Application.java

Author: omalley
Date: Fri Mar  4 04:48:01 2011
New Revision: 1077720

URL: http://svn.apache.org/viewvc?rev=1077720&view=rev
Log:
commit 2dd37053e358934dc7e81378d793c395cb0f759e
Author: Jitendra Nath Pandey <jitendra@sufferhome-lm.(none)>
Date:   Mon Sep 20 19:51:51 2010 -0700

    MAPREDUCE-2082  from https://issues.apache.org/jira/secure/attachment/12455109/MAPREDUCE-2082-y20.1.patch
    
    +++ b/YAHOO-CHANGES.txt
    +
    +    MAPREDUCE-2082 Race condition in writing the jobtoken password file when
    +    launching pipes jobs (jitendra and ddas)

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/pipes/Application.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/pipes/Application.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/pipes/Application.java?rev=1077720&r1=1077719&r2=1077720&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/pipes/Application.java (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/pipes/Application.java Fri Mar  4 04:48:01 2011
@@ -101,7 +101,7 @@ class Application<K1 extends WritableCom
     // This password is used as shared secret key between this application and
     // child pipes process
     byte[]  password = jobToken.getPassword();
-    String localPasswordFile = conf.getJobLocalDir() + Path.SEPARATOR
+    String localPasswordFile = new File(".") + Path.SEPARATOR
         + "jobTokenPassword";
     writePasswordToLocalFile(localPasswordFile, password, conf);
     env.put("hadoop.pipes.shared.secret.location", localPasswordFile);
@@ -167,10 +167,6 @@ class Application<K1 extends WritableCom
       byte[] password, JobConf conf) throws IOException {
     FileSystem localFs = FileSystem.getLocal(conf);
     Path localPath = new Path(localPasswordFile);
-    if (localFs.isFile(localPath)) {
-      LOG.debug("Password file is already created by previous path");
-      return;
-    }
     FSDataOutputStream out = FileSystem.create(localFs, localPath,
         new FsPermission("400"));
     out.write(password);