530418d
diff -ur root-5.34.09.orig/io/hdfs/src/THDFSFile.cxx root-5.34.09/io/hdfs/src/THDFSFile.cxx
530418d
--- root-5.34.09.orig/io/hdfs/src/THDFSFile.cxx	2013-06-26 17:05:06.000000000 +0200
530418d
+++ root-5.34.09/io/hdfs/src/THDFSFile.cxx	2013-08-31 03:00:10.323742733 +0200
530418d
@@ -40,6 +40,7 @@
530418d
 
530418d
 #include "syslog.h"
530418d
 #include "assert.h"
530418d
+#include "stdlib.h"
530418d
 
530418d
 #include "THDFSFile.h"
530418d
 #include "TError.h"
530418d
@@ -93,8 +94,7 @@
530418d
    if (has_authn) {
530418d
       UserGroup_t *ugi = gSystem->GetUserInfo(0);
530418d
       const char *user = (ugi->fUser).Data();
530418d
-      const char * groups[1] = {(ugi->fGroup.Data())};
530418d
-      fFS = hdfsConnectAsUser("default", 0, user, groups, 1);
530418d
+      fFS = hdfsConnectAsUser("default", 0, user);
530418d
       delete ugi;
530418d
    } else {
530418d
       fFS = hdfsConnect("default", 0);
530418d
@@ -167,7 +167,7 @@
530418d
    // See documentation for TFile::SysRead().
530418d
 
530418d
    TRACE("READ")
530418d
-   tSize num_read = hdfsPread(fFS, (hdfsFile)fHdfsFH, fSysOffset, buf, len);
530418d
+   tSize num_read = hdfsPread((hdfsFS)fFS, (hdfsFile)fHdfsFH, fSysOffset, buf, len);
530418d
    fSysOffset += len;
530418d
    if (num_read < 0) {
530418d
       gSystem->SetErrorStr(strerror(errno));
530418d
@@ -192,7 +192,7 @@
530418d
          return -1;
530418d
       }
530418d
       if (fSize == -1) {
530418d
-         hdfsFileInfo *info = hdfsGetPathInfo(fFS, fPath);
530418d
+         hdfsFileInfo *info = hdfsGetPathInfo((hdfsFS)fFS, fPath);
530418d
          if (info != 0) {
530418d
             fSize = info->mSize;
530418d
             free(info);
530418d
@@ -224,7 +224,7 @@
530418d
       SysError("THDFSFile", "Unable to allocate memory for path.");
530418d
    }
530418d
    strlcpy(fPath, file,path_size+1);
530418d
-   if ((fHdfsFH = hdfsOpenFile(fFS, fPath, flags, 0, 0, 0)) == 0) {
530418d
+   if ((fHdfsFH = hdfsOpenFile((hdfsFS)fFS, fPath, flags, 0, 0, 0)) == 0) {
530418d
       SysError("THDFSFile", "Unable to open file %s in HDFS", pathname);
530418d
       return -1;
530418d
    }
530418d
@@ -236,7 +236,7 @@
530418d
 {
530418d
    // Close the file in HDFS.
530418d
 
530418d
-   int result = hdfsCloseFile(fFS, (hdfsFile)fHdfsFH);
530418d
+   int result = hdfsCloseFile((hdfsFS)fFS, (hdfsFile)fHdfsFH);
530418d
    fFS = 0;
530418d
    fHdfsFH = 0;
530418d
    return result;
530418d
@@ -258,7 +258,7 @@
530418d
 
530418d
    *id = ::Hash(fPath);
530418d
 
530418d
-   hdfsFileInfo *info = hdfsGetPathInfo(fFS, fPath);
530418d
+   hdfsFileInfo *info = hdfsGetPathInfo((hdfsFS)fFS, fPath);
530418d
    if (info != 0) {
530418d
       fSize = info->mSize;
530418d
       *size = fSize;
530418d
@@ -306,8 +306,7 @@
530418d
    if (has_authn) {
530418d
       UserGroup_t *ugi = gSystem->GetUserInfo(0);
530418d
       const char *user = (ugi->fUser).Data();
530418d
-      const char * groups[1] = {(ugi->fGroup.Data())};
530418d
-      fFH = hdfsConnectAsUser("default", 0, user, groups, 1);
530418d
+      fFH = hdfsConnectAsUser("default", 0, user);
530418d
       delete ugi;
530418d
    } else {
530418d
       fFH = hdfsConnect("default", 0);
530418d
@@ -339,7 +338,7 @@
530418d
    }
530418d
 
530418d
    if (R__HDFS_ALLOW_CHANGES == kTRUE) {
530418d
-      return hdfsCreateDirectory(fFH, path);
530418d
+      return hdfsCreateDirectory((hdfsFS)fFH, path);
530418d
    } else {
530418d
       return -1;
530418d
    }
530418d
@@ -366,14 +365,14 @@
530418d
 */
530418d
 
530418d
    hdfsFileInfo * dir = 0;
530418d
-   if ((dir = hdfsGetPathInfo(fFH, path)) == 0) {
530418d
+   if ((dir = hdfsGetPathInfo((hdfsFS)fFH, path)) == 0) {
530418d
       return 0;
530418d
    }
530418d
    if (dir->mKind != kObjectKindDirectory) {
530418d
       return 0;
530418d
    }
530418d
 
530418d
-   fDirp = (void *)hdfsListDirectory(fFH, path, &fDirEntries);
530418d
+   fDirp = (void *)hdfsListDirectory((hdfsFS)fFH, path, &fDirEntries);
530418d
    fDirCtr = 0;
530418d
 
530418d
    fUrlp = new TUrl[fDirEntries];
530418d
@@ -449,7 +448,7 @@
530418d
       Error("GetPathInfo", "No filesystem handle (should never happen)");
530418d
       return 1;
530418d
    }
530418d
-   hdfsFileInfo *fileInfo = hdfsGetPathInfo(fFH, path);
530418d
+   hdfsFileInfo *fileInfo = hdfsGetPathInfo((hdfsFS)fFH, path);
530418d
 
530418d
    if (fileInfo == 0)
530418d
       return 1;
530418d
@@ -481,7 +480,7 @@
530418d
       return kTRUE;
530418d
    }
530418d
 
530418d
-   if (hdfsExists(fFH, path) == 0)
530418d
+   if (hdfsExists((hdfsFS)fFH, path) == 0)
530418d
       return kFALSE;
530418d
    else
530418d
       return kTRUE;
530418d
@@ -499,7 +498,7 @@
530418d
    }
530418d
 
530418d
    if (R__HDFS_ALLOW_CHANGES == kTRUE) {
530418d
-      return hdfsDelete(fFH, path);
530418d
+      return hdfsDelete((hdfsFS)fFH, path, 1);
530418d
    } else {
530418d
       return -1;
530418d
    }