FreeBSD 6.2
gcc version 3.4.6 [FreeBSD] 20060305
> cd cpu-1.4.3
> ./configure --with-ldap=/usr/local
> make
ld.c: In function `getlGid':
ld.c:806: error: subscripted value is neither array nor pointer
and the following patch makes all things fine:
--- ld.c.orig Tue Mar 27 17:14:05 2007
+++ ld.c Tue Mar 27 15:15:41 2007
@@ -771,6 +771,7 @@
NULL
};
char *gid = NULL;
+ char **gid_ = NULL;
cn = cfg_get_str ("LDAP", "GROUP_CN_STRING");
if (cn == NULL)
@@ -803,9 +804,9 @@
return -10;
if (gid != NULL)
{
- gid = ldap_get_values (ld, pos, gid)[0];
- if (gid != NULL)
- return atoi (gid);
+ gid_ = ldap_get_values (ld, pos, gid);
+ if (gid_ != NULL && gid_[0] != NULL)
+ return atoi (gid_[0]);
else
return -10;
}
patch for cpu-1.4.3/src/plugins/ldap/ld.c