* 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/
#include <libgen.h>
#include <syslog.h>
-#include <liblustre.h>
+#include <libcfs/libcfs.h>
#include <lustre/lustre_user.h>
#include <lustre/lustre_idl.h>
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;
}
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);