[SSSD] [PATCH] check if gid attribute is empty
Sumit Bose
sbose at redhat.com
Fri Aug 28 09:49:44 UTC 2009
Hi,
this patch just makes sure that the LDAP backend does not die if the
group object returned by the LDAP server does not contain a gid. In a
previous patch I have sent the same fix for uid/gid in a returned user
object, but have forgotten the group object.
bye,
Sumit
-------------- next part --------------
>From a9a1c7e26b919c2edb6fa64fbb4e7d9e243eb565 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Thu, 27 Aug 2009 14:05:36 +0200
Subject: [PATCH] check if gid attribute is empty
---
server/providers/ldap/sdap_async.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/server/providers/ldap/sdap_async.c b/server/providers/ldap/sdap_async.c
index 4d74061..852c6d2 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) {
--
1.6.2.5
More information about the sssd-devel
mailing list