[ 
https://issues.apache.org/jira/browse/HADOOP-3256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12589401#action_12589401
 ] 

Amareshwari Sriramadasu commented on HADOOP-3256:
-------------------------------------------------

The encoding you are doing in jobhistory is not needed, because you are 
encoding the logFile in jobHistory.java before creating.
And listpaths will give encoded name. jobFile.toString() will give correct path 
to be passed for jsps, right?
{code}
+      // Encode the logfile name again to cancel the decoding done by the 
browser
+      String encodedJobFileName = 
+          
JobHistory.JobInfo.encodeJobHistoryFileName(jobFile.getName().toString());
{code}

the above encoding and passing it for jsps is not correct, since 
jobFile.getName() is already encoded name. Thus patch needs only decoding of 
jobFile.getName() for extracting values of jobtracker hostname, starttime, 
jobid, username and jobname.

> JobHistory file on HDFS should not use the 'job name'
> -----------------------------------------------------
>
>                 Key: HADOOP-3256
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3256
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: mapred
>    Affects Versions: 0.17.0
>            Reporter: Arun C Murthy
>            Assignee: Arun C Murthy
>            Priority: Blocker
>             Fix For: 0.17.0
>
>         Attachments: HADOOP-3256_0_20080414.patch, 
> HADOOP-3256_1_20080415.patch, HADOOP-3256_2_20080415.patch
>
>
> HADOOP-2178 introduced the feature of saving jobhistory logs on HDFS.
> Unfortunately the following code:
> {noformat}
>         // setup the history log file for this job
>         String logFileName = jobUniqueString +  
>                              "_" + user+ "_" + jobName;
>         if (logFileName.length() > MAX_FILENAME_SIZE) {
>           logFileName = logFileName.substring(0, MAX_FILENAME_SIZE-1);
>         }
> {noformat}
> is vulnerable to user-provided job names. 
> Specifically I ran into 'URISyntaxException' with jobs whose names include a 
> ":".
> The easy fix is to ensure that we do not use the human-friendly job names and 
> only the jobid.
> The long term fix is to ensure that Path handles filenames with _any_ 
> characters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to