You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Hudson (JIRA)" <ji...@apache.org> on 2016/06/30 01:18:12 UTC
[jira] [Commented] (HADOOP-12345) Pad hostname correctly in
CredentialsSys.java
[ https://issues.apache.org/jira/browse/HADOOP-12345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15356284#comment-15356284 ]
Hudson commented on HADOOP-12345:
---------------------------------
SUCCESS: Integrated in Hadoop-trunk-Commit #10040 (See [https://builds.apache.org/job/Hadoop-trunk-Commit/10040/])
HADOOP-12345. Pad hostname correctly in CredentialsSys.java. Contributed (wang: rev 846ada2de33f9840d6e60fd7339ecc2d71f277c7)
* hadoop-common-project/hadoop-nfs/src/test/java/org/apache/hadoop/oncrpc/security/TestCredentialsSys.java
* hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/CredentialsSys.java
* hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/oncrpc/security/Credentials.java
> Pad hostname correctly in CredentialsSys.java
> ---------------------------------------------
>
> Key: HADOOP-12345
> URL: https://issues.apache.org/jira/browse/HADOOP-12345
> Project: Hadoop Common
> Issue Type: Bug
> Components: nfs
> Affects Versions: 2.6.0, 2.7.0
> Reporter: Pradeep Nayak Udupi Kadbet
> Assignee: Pradeep Nayak Udupi Kadbet
> Priority: Critical
> Fix For: 2.8.0
>
> Attachments: HADOOP-12345.001.patch, HADOOP-12345.002.patch, HADOOP-12345.patch
>
>
> Hi -
> There is a bug in the way hadoop-nfs sets the credential length in "Credentials" field of the NFS RPC packet when using AUTH_SYS
> In CredentialsSys.java, when we are writing the creds in to XDR object, we set the length as follows:
> // mStamp + mHostName.length + mHostName + mUID + mGID + mAuxGIDs.count
> 96 mCredentialsLength = 20 + mHostName.getBytes().length;
> (20 corresponds to 4 bytes for mStamp, 4 bytes for mUID, 4 bytes for mGID, 4 bytes for length field of hostname, 4 bytes for number of aux 4 gids) and this is okay.
> However when we add the length of the hostname to this, we are not adding the extra padded bytes for the hostname (If the length is not a multiple of 4) and thus when the NFS server reads the packet, it returns GARBAGE_ARGS because it doesn't read the uid field when it is expected to read. I can reproduce this issue constantly on machines where the hostname length is not a multiple of 4.
> A possible fix is to do something this:
> int pad = mHostName.getBytes().length % 4;
> // mStamp + mHostName.length + mHostName + mUID + mGID + mAuxGIDs.count
> mCredentialsLength = 20 + mHostName.getBytes().length + pad;
> I would be happy to submit the patch but I need some help to commit into mainline. I haven't committed into Hadoop yet.
> Cheers!
> Pradeep
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org