Author: atm
Date: Fri Jun 27 12:03:33 2014
New Revision: 1606043

URL: http://svn.apache.org/r1606043
Log:
HADOOP-10701. NFS should not validate the access premission only based on the 
user's primary group. Contributed by Harsh J.

Added:
    
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/dev-support/
    
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/dev-support/findbugsExcludeFile.xml
Modified:
    hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/pom.xml
    
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/CredentialsSys.java
    
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/SecurityHandler.java
    
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/SysSecurityHandler.java

Added: 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/dev-support/findbugsExcludeFile.xml
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/dev-support/findbugsExcludeFile.xml?rev=1606043&view=auto
==============================================================================
--- 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/dev-support/findbugsExcludeFile.xml
 (added)
+++ 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/dev-support/findbugsExcludeFile.xml
 Fri Jun 27 12:03:33 2014
@@ -0,0 +1,28 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<FindBugsFilter>
+  <!--
+    FindBugs is complaining about CredentialsSys#getAuxGIDs(...) returning
+    a mutable array, but it is alright in our case, and copies would be
+    more expensive instead.
+  -->
+  <Match>
+      <Class name="org.apache.hadoop.oncrpc.security.CredentialsSys"/>
+      <Method name="getAuxGIDs" params="" returns="int[]"/>
+      <Bug code="EI"/>
+  </Match>
+</FindBugsFilter>

Modified: 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/pom.xml
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/pom.xml?rev=1606043&r1=1606042&r2=1606043&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/pom.xml 
(original)
+++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/pom.xml 
Fri Jun 27 12:03:33 2014
@@ -93,6 +93,18 @@
     </dependency>
   </dependencies>
 
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>findbugs-maven-plugin</artifactId>
+        <configuration>
+          <excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml
+          </excludeFilterFile>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
 
   <profiles>
     <profile>

Modified: 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/CredentialsSys.java
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/CredentialsSys.java?rev=1606043&r1=1606042&r2=1606043&view=diff
==============================================================================
--- 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/CredentialsSys.java
 (original)
+++ 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/CredentialsSys.java
 Fri Jun 27 12:03:33 2014
@@ -58,6 +58,10 @@ public class CredentialsSys extends Cred
     return mUID;
   }
 
+  public int[] getAuxGIDs() {
+    return mAuxGIDs;
+  }
+
   public void setGID(int gid) {
     this.mGID = gid;
   }
@@ -65,7 +69,7 @@ public class CredentialsSys extends Cred
   public void setUID(int uid) {
     this.mUID = uid;
   }
-  
+
   public void setStamp(int stamp) {
     this.mStamp = stamp;
   }

Modified: 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/SecurityHandler.java
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/SecurityHandler.java?rev=1606043&r1=1606042&r2=1606043&view=diff
==============================================================================
--- 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/SecurityHandler.java
 (original)
+++ 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/SecurityHandler.java
 Fri Jun 27 12:03:33 2014
@@ -60,4 +60,9 @@ public abstract class SecurityHandler {
   public int getGid() {
     throw new UnsupportedOperationException();
   }
+
+  /** Used by AUTH_SYS */
+  public int[] getAuxGids() {
+    throw new UnsupportedOperationException();
+  }
 }

Modified: 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/SysSecurityHandler.java
URL: 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/SysSecurityHandler.java?rev=1606043&r1=1606042&r2=1606043&view=diff
==============================================================================
--- 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/SysSecurityHandler.java
 (original)
+++ 
hadoop/common/branches/branch-2/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/SysSecurityHandler.java
 Fri Jun 27 12:03:33 2014
@@ -56,4 +56,9 @@ public class SysSecurityHandler extends 
   public int getGid() {
     return mCredentialsSys.getGID();
   }
+
+  @Override
+  public int[] getAuxGids() {
+    return mCredentialsSys.getAuxGIDs();
+  }
 }


Reply via email to