Selaa lähdekoodia

HADOOP-10781. Unportable getgrouplist usage breaks FreeBSD (Dmitry Sivachenko via Colin Patrick McCabe)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1608869 13f79535-47bb-0310-9956-ffa450edef68
Colin McCabe 11 vuotta sitten
vanhempi
commit
c030bac84f

+ 3 - 0
hadoop-common-project/hadoop-common/CHANGES.txt

@@ -679,6 +679,9 @@ Release 2.5.0 - UNRELEASED
     HADOOP-10419 BufferedFSInputStream NPEs on getPos() on a closed stream
     (stevel)
 
+    HADOOP-10781. Unportable getgrouplist() usage breaks FreeBSD (Dmitry
+    Sivachenko via Colin Patrick McCabe)
+
   BREAKDOWN OF HADOOP-10514 SUBTASKS AND RELATED JIRAS
 
     HADOOP-10520. Extended attributes definition and FileSystem APIs for

+ 1 - 1
hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/security/hadoop_user_info.c

@@ -193,7 +193,7 @@ int hadoop_user_info_getgroups(struct hadoop_user_info *uinfo)
   ngroups = uinfo->gids_size;
   ret = getgrouplist(uinfo->pwd.pw_name, uinfo->pwd.pw_gid, 
                          uinfo->gids, &ngroups);
-  if (ret > 0) {
+  if (ret >= 0) {
     uinfo->num_gids = ngroups;
     ret = put_primary_gid_first(uinfo);
     if (ret) {