X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Futils%2Fl_getidentity.c;h=3729f3fffcb3143ae82512f3e4c20595ed941ca7;hb=refs%2Fchanges%2F33%2F6533%2F3;hp=c7655b2fc697a1c968ddcde6455021a5421626ed;hpb=994f4878a9bccb62f087d684aa93ee7f184f202b;p=fs%2Flustre-release.git diff --git a/lustre/utils/l_getidentity.c b/lustre/utils/l_getidentity.c index c7655b2..3729f3f 100644 --- a/lustre/utils/l_getidentity.c +++ b/lustre/utils/l_getidentity.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, Whamcloud, Inc. + * Copyright (c) 2011, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -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; } @@ -428,6 +431,10 @@ int main(int argc, char **argv) maxgroups = sysconf(_SC_NGROUPS_MAX); if (maxgroups > NGROUPS_MAX) maxgroups = NGROUPS_MAX; + if (maxgroups == -1) { + rc = -EINVAL; + goto out; + } size = offsetof(struct identity_downcall_data, idd_groups[maxgroups]); data = malloc(size);