The LU-2107 patch to l_getidentity does not set the data->idd_err
value to errno, and does not log the uid when getgrouplist() fails.
This patch fixes both of those concerns.
Signed-off-by: Patrick Farrell <paf@cray.com>
Change-Id: I8a5715bada61a4c69d4d875b60097f9414a25f1c
Reviewed-on: http://review.whamcloud.com/6533
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
groups_tmp = malloc(maxgroups * sizeof(gid_t));
if (groups_tmp == NULL) {
free(pw_name);
- errlog("malloc error\n");
+ data->idd_err = errno ? errno : ENOMEM;
+ errlog("malloc error=%u\n",data->idd_err);
return -1;
}
0) {
free(pw_name);
free(groups_tmp);
- errlog("getgrouplist() error\n");
+ data->idd_err = errno ? errno : EIDRM;
+ errlog("getgrouplist() error for uid %u: error=%u\n",
+ data->idd_uid, data->idd_err);
return -1;
}