[
https://issues.apache.org/jira/browse/HADOOP-6614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13153772#comment-13153772
]
Jonathan Hsieh commented on HADOOP-6614:
----------------------------------------
Did not include test case, but if you run this test you should see Permission
denied behavior.
{code}
@Test
public void testPermsError() throws IOException {
// assume I am user without write perms to this dir
File dir = new File("/lib");
try {
File f = File.createTempFile("hadoop-unjar", "", dir);
System.out.println(f.getName());
} catch (IOException se) {
// "Permission Denied /lib"
System.err.print("Failed to create tmp dir " + dir + " because of " +
se.getMessage());
return;
}
fail("should have caught perms exception");
}
{code}
> RunJar should provide more diags when it can't create a temp file
> -----------------------------------------------------------------
>
> Key: HADOOP-6614
> URL: https://issues.apache.org/jira/browse/HADOOP-6614
> Project: Hadoop Common
> Issue Type: Improvement
> Components: util
> Affects Versions: 0.22.0
> Reporter: Steve Loughran
> Assignee: Jonathan Hsieh
> Priority: Minor
> Attachments: hadoop-6614.patch
>
>
> When you see a stack trace about permissions, it is better if the trace
> included the file/directory at fault:
> {code}
> Exception in thread "main" java.io.IOException: Permission denied
> at java.io.UnixFileSystem.createFileExclusively(Native Method)
> at java.io.File.checkAndCreate(File.java:1704)
> at java.io.File.createTempFile(File.java:1792)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:147)
> {code}
> As it is, you need to go into the code, discover that it's
> {{${hadoop.tmp.dir}/hadoop-unjar}}, but you need to know the value of
> hadoop.tmp.dir to really find out what the problem is.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira