Repository: hadoop
Updated Branches:
  refs/heads/trunk 026dfddfa -> 50625e660


HDFS-7771. fuse_dfs should permit FILE: on the front of KRB5CCNAME (cmccabe)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/50625e66
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/50625e66
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/50625e66

Branch: refs/heads/trunk
Commit: 50625e660ac0f76e7fe46d55df3d15cbbf058753
Parents: 026dfdd
Author: Colin Patrick Mccabe <[email protected]>
Authored: Wed Feb 11 12:14:23 2015 -0800
Committer: Colin Patrick Mccabe <[email protected]>
Committed: Wed Feb 11 12:14:40 2015 -0800

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt         |  3 +++
 .../src/main/native/fuse-dfs/fuse_connect.c         | 16 ++++++++++++++++
 2 files changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/50625e66/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt 
b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index dd90c86..9a6c551 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -918,6 +918,9 @@ Release 2.7.0 - UNRELEASED
     HDFS-7736. Fix typos in dfsadmin/fsck/snapshotDiff usage messages.
     (Brahma Reddy Battula via wheat9)
 
+    HDFS-7771. fuse_dfs should permit FILE: on the front of KRB5CCNAME
+    (cmccabe)
+
 Release 2.6.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/50625e66/hadoop-hdfs-project/hadoop-hdfs/src/main/native/fuse-dfs/fuse_connect.c
----------------------------------------------------------------------
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/native/fuse-dfs/fuse_connect.c 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/native/fuse-dfs/fuse_connect.c
index 218c5c9..8a2a00b 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/native/fuse-dfs/fuse_connect.c
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/native/fuse-dfs/fuse_connect.c
@@ -28,6 +28,7 @@
 #include <search.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sys/time.h>
 #include <sys/types.h>
 #include <utime.h>
@@ -358,6 +359,15 @@ static void hdfsConnExpiry(void)
   pthread_mutex_unlock(&gConnMutex);
 }
 
+// The Kerberos FILE: prefix.  This indicates that the kerberos ticket cache
+// specifier is a file.  (Note that we also assume that the specifier is a file
+// if no prefix is present.)
+#define KRB_FILE_PREFIX "FILE:"
+
+// Length of the Kerberos file prefix, which is equal to the string size in
+// bytes minus 1 (because we don't count the null terminator in the length.)
+#define KRB_FILE_PREFIX_LEN (sizeof(KRB_FILE_PREFIX) - 1)
+
 /**
  * Find the Kerberos ticket cache path.
  *
@@ -414,6 +424,12 @@ done:
   } else {
     path[pathIdx] = '\0';
   }
+  if (strncmp(path, KRB_FILE_PREFIX, KRB_FILE_PREFIX_LEN) == 0) {
+    fprintf(stderr, "stripping " KRB_FILE_PREFIX " from the front of "
+            "KRB5CCNAME.\n");
+    memmove(path, path + KRB_FILE_PREFIX_LEN,
+            strlen(path + KRB_FILE_PREFIX_LEN) + 1);
+  }
 }
 
 /**

Reply via email to