[ 
https://issues.apache.org/jira/browse/HIVE-7295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14044354#comment-14044354
 ] 

Chris Nauroth commented on HIVE-7295:
-------------------------------------

Hi, [~xiaobingo].  Yes, this is something particular to Windows.  If you're 
logged in as a user in the administrators group, then files you create on the 
local file system will be owned by the administrators group, not your 
individual user.  Here is an example running winutils ls on a file I created 
while logged in as a member of the administrators group:

{code}
C:\test>C:\hdc\hadoop-common-project\hadoop-common\target\bin\winutils.exe ls 
C:\test\hello
-rwx------ 1 BUILTIN\Administrators CNAUROTH-VM-1\None 8 Jan 14 2014 
C:\test\hello
{code}

Here is the same thing run on a different VM, where my user is not a member of 
the administrators group:

{code}
C:\test>C:\hdc\hadoop-common-project\hadoop-common\target\bin\winutils.exe ls 
C:\test\hello
-rwx------ 1 WIN-NCDLEQLC13J\cnauroth WIN-NCDLEQLC13J\None 8 Jun 26 2014 
C:\test\hello
{code}

There isn't really any way to change code to work around this.  The only 
workaround is to run unit tests as a user who is not a member of the 
administrators group.

Note that when you set up a non-admin user for yourself, you'll need to make 
sure that user has Create Symbolic Links permission.  The code in Hadoop core 
relies on creating symlinks for a couple of important things, notably 
{{MiniYARNCluster}}.  Admins get this permission automatically, but regular 
users don't.  This page describes how to grant the permission to a regular user:

http://superuser.com/questions/104845/permission-to-make-symbolic-links-in-windows-7

Hope this helps.


> FileStatus.getOwner on Windows returns name of group the user belongs to, 
> instead of user name expected, fails many authorization related unit tests
> ----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-7295
>                 URL: https://issues.apache.org/jira/browse/HIVE-7295
>             Project: Hive
>          Issue Type: Bug
>          Components: Authorization, HCatalog, Security, Windows
>    Affects Versions: 0.13.0
>         Environment: Windows Server 2008 R2
>            Reporter: Xiaobing Zhou
>            Priority: Critical
>
> Unit test in TestHdfsAuthorizationProvider, e.g. 
> org.apache.hcatalog.security.TestHdfsAuthorizationProvider.testTableOps. 
> fails to run.
> Running org.apache.hcatalog.security.TestHdfsAuthorizationProvider
> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 15.799 sec 
> <<< FAILURE! - in org.apache.hcatalog.security.TestHdfsAuthorizationProvider
> testTableOps(org.apache.hcatalog.security.TestHdfsAuthorizationProvider)  
> Time elapsed: 15.546 sec  <<< FAILURE!
> junit.framework.AssertionFailedError: FAILED: AuthorizationException 
> org.apache.hadoop.security.AccessControlException: action WRITE not permitted 
> on path pfile:/Users/xz
> hou/hworks/workspace/hwx-hive-ws/hive/hcatalog/core/target/warehouse for user 
> xzhou expected:<0> but was:<40000>
>         at junit.framework.Assert.fail(Assert.java:50)
>         at junit.framework.Assert.failNotEquals(Assert.java:287)
>         at junit.framework.Assert.assertEquals(Assert.java:67)
>         at junit.framework.Assert.assertEquals(Assert.java:199)
>         at 
> org.apache.hcatalog.security.TestHdfsAuthorizationProvider.exec(TestHdfsAuthorizationProvider.java:172)
>         at 
> org.apache.hcatalog.security.TestHdfsAuthorizationProvider.testTableOps(TestHdfsAuthorizationProvider.java:307)
>         



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to