Author: daijy Date: Tue Sep 3 23:16:51 2013 New Revision: 1519884 URL: http://svn.apache.org/r1519884 Log: HIVE-4441: WebHCat does not honor user home directory (Daniel Dai)
Modified: hive/trunk/RELEASE_NOTES.txt hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/TempletonUtils.java Modified: hive/trunk/RELEASE_NOTES.txt URL: http://svn.apache.org/viewvc/hive/trunk/RELEASE_NOTES.txt?rev=1519884&r1=1519883&r2=1519884&view=diff ============================================================================== --- hive/trunk/RELEASE_NOTES.txt (original) +++ hive/trunk/RELEASE_NOTES.txt Tue Sep 3 23:16:51 2013 @@ -15,9 +15,6 @@ Release Notes - Hive - Version 0.11.0 * [HIVE-4326] - Clean up remaining items in hive/hcatalog/historical/trunk ** Bug - * [HIVE-4441] - WebHCat does not honor user home directory - * [HIVE-4442] - WebHCat should not override user.name parameter for Queue call - * [HIVE-4586] - WebHCat should return 404 error for undefined resource * [HIVE-4820] - webhcat_config.sh should set default values for HIVE_HOME and HCAT_PREFIX that work with default build tree structure * [HIVE-2264] - Hive server is SHUTTING DOWN when invalid queries beeing executed. * [HIVE-2332] - If all of the parameters of distinct functions are exists in group by columns, query fails in runtime Modified: hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/TempletonUtils.java URL: http://svn.apache.org/viewvc/hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/TempletonUtils.java?rev=1519884&r1=1519883&r2=1519884&view=diff ============================================================================== --- hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/TempletonUtils.java (original) +++ hive/trunk/hcatalog/webhcat/svr/src/main/java/org/apache/hcatalog/templeton/tool/TempletonUtils.java Tue Sep 3 23:16:51 2013 @@ -229,7 +229,7 @@ public class TempletonUtils { return result; } - public static Path hadoopFsPath(final String fname, final Configuration conf, String user) + public static Path hadoopFsPath(String fname, final Configuration conf, String user) throws URISyntaxException, IOException, InterruptedException { if (fname == null || conf == null) { @@ -237,11 +237,13 @@ public class TempletonUtils { } UserGroupInformation ugi = UgiFactory.getUgi(user); + final String finalFName = new String(fname); + final FileSystem defaultFs = ugi.doAs(new PrivilegedExceptionAction<FileSystem>() { public FileSystem run() throws URISyntaxException, IOException, InterruptedException { - return FileSystem.get(new URI(fname), conf); + return FileSystem.get(new URI(finalFName), conf); } });