Whamcloud - gitweb
LU-3435 util: Improvement to error logging for l_getidentity 33/6533/3
authorPatrick Farrell <paf@cray.com>
Tue, 4 Jun 2013 18:19:24 +0000 (13:19 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 10 Jul 2013 02:38:10 +0000 (02:38 +0000)
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>
lustre/utils/l_getidentity.c

index 936f494..3729f3f 100644 (file)
@@ -137,7 +137,8 @@ int get_groups_local(struct identity_downcall_data *data,
        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;
        }
 
@@ -146,7 +147,9 @@ int get_groups_local(struct identity_downcall_data *data,
            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;
        }