HADOOP-10442. Group look-up can cause segmentation fault when certain JNI-based mapping module is used. (Kihwal Lee via jeagles)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1582452 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Turner Eagles 2014-03-27 20:08:47 +00:00
parent 67fd877105
commit edd6aa54cb
2 changed files with 8 additions and 0 deletions

View File

@ -199,6 +199,9 @@ Release 2.4.0 - UNRELEASED
HADOOP-10399. FileContext API for ACLs. (Vinayakumar B via cnauroth) HADOOP-10399. FileContext API for ACLs. (Vinayakumar B via cnauroth)
HADOOP-10442. Group look-up can cause segmentation fault when certain
JNI-based mapping module is used. (Kihwal Lee via jeagles)
Release 2.3.1 - UNRELEASED Release 2.3.1 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -178,6 +178,11 @@ int hadoop_user_info_getgroups(struct hadoop_user_info *uinfo)
return ret; return ret;
} }
return 0; return 0;
} else if (ret != -1) {
// Any return code that is not -1 is considered as error.
// Since the user lookup was successful, there should be at least one
// group for this user.
return EIO;
} }
ngids = realloc(uinfo->gids, sizeof(uinfo->gids[0]) * ngroups); ngids = realloc(uinfo->gids, sizeof(uinfo->gids[0]) * ngroups);
if (!ngids) { if (!ngids) {