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
This commit is contained in:
Colin McCabe 2014-07-08 18:15:25 +00:00
parent 3470dd9a2f
commit c030bac84f
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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) {