From 8d235172e656dd126aa03132acfba6c66f4ce03e Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Thu, 27 Aug 2009 14:05:36 +0200 Subject: check if gid attribute is empty --- server/providers/ldap/sdap_async.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'server/providers') diff --git a/server/providers/ldap/sdap_async.c b/server/providers/ldap/sdap_async.c index 4d74061f..852c6d23 100644 --- a/server/providers/ldap/sdap_async.c +++ b/server/providers/ldap/sdap_async.c @@ -1151,6 +1151,12 @@ static struct tevent_req *sdap_save_group_send(TALLOC_CTX *memctx, ret = sysdb_attrs_get_el(state->attrs, opts->group_map[SDAP_AT_GROUP_GID].sys_name, &el); if (ret) goto fail; + if (el->num_values == 0) { + DEBUG(1, ("no gid provided for [%s] in domain [%s].\n", + state->name, dom->name)); + ret = EINVAL; + goto fail; + } errno = 0; l = strtol((const char *)el->values[0].data, NULL, 0); if (errno) { -- cgit