This is a discussion on Re: [courier-users] Unable to build Courier Authlib LDAP 0.59.1 on within the Courier-Imap forums, part of the Mail Servers and Related category; On Sat, Jan 20, 2007 at 05:50:56PM +0100, Sander Holthaus wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
On Sat, Jan 20, 2007 at 05:50:56PM +0100, Sander Holthaus wrote:
> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I'm trying to build Courier-authlib-ldap from freebsd ports. I get the > following fatal error-message during the process: > > authldaplib.c: In function `l_get_values': > authldaplib.c:137: syntax error before `char' > authldaplib.c:139: `a' undeclared (first use in this function) > authldaplib.c:139: (Each undeclared identifier is reported only once > authldaplib.c:139: for each function it appears in.) > authldaplib.c:146: syntax error before `int' > authldaplib.c:148: `i' undeclared (first use in this function) > authldaplib.c: In function `l_search': > authldaplib.c:241: syntax error before `int' > authldaplib.c:244: `msgid' undeclared (first use in this function) > authldaplib.c:249: warning: control reaches end of non-void function Well, interesting. Variables are being declared *after* intial function entrance and not part of a loop statement of some kind. This will break a lot of compilers and is not ANSIC compliant if I remember my ANSIC. Movement of: char **a=malloc((n + 1) * sizeof(char *)); to above the: if (!p) declaration will probably fix it. Same issues at lines 146 and 241. Looks like GCC 3.x is hiding this fact - as I posited before. These kinds of coding errors/mistypes are not in authmysqllib.c (I don't use LDAP anywhere). My FreeBSD 4 systems don't have issues because of that (so far). Code where initial problem lies: static char **l_get_values(LDAP *ld, LDAPMessage *entry, const char *attribut) { struct berval **p=ldap_get_values_len(ld, entry, attribut); int n; if (!p) return NULL; n=ldap_count_values_len(p); --> char **a=malloc((n + 1) * sizeof(char *)); <-- if (!a) { DPRINTF("malloc failed"); ldap_value_free_len(p); return NULL; } -- Mike Horwath, reachable via drechsau@Geeks.ORG ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?p...rge&CID=DEVDEV _______________________________________________ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/.../courier-users |
![]() |
| Thread Tools | |
| Display Modes | |
|
|