[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: modify.c problem : unresolved snprintf (ITS#1223)



Hello Kurt,

I have SunOS 5.5.1 and using gcc2.95.2.  
All libs are set.

Jeronimo


-----Original Message-----
From:	Kurt D. Zeilenga [SMTP:Kurt@OpenLDAP.org]
Sent:	Saturday, July 07, 2001 5:15 AM
To:	jeronimo@holhouse.nl
Cc:	openldap-its@OpenLDAP.org
Subject:	Re: modify.c problem : unresolved snprintf  (ITS#1223)

Solaris should contain snprintf in the Standard C library (-lc).
Which version of Solaris are you using?  Which compiler?
Which C libraries?

Kurt

At 08:24 AM 7/5/2001, jeronimo@holhouse.nl wrote:
>Full_Name: Jeronimo de Bastos
>Version: 2.0.11
>OS: Solaris
>URL: ftp://ftp.openldap.org/incoming/
>Submission from: (NULL) (193.78.7.5)
>
>
>Hello,
>
>I encounter an unresolved symbol when building in file modify.c:
>symbol is snprintf()
>
>When I looked at daemon.c I see an #ifdef around the code for snprintf.
>
>So I did the same at modify.c and that did it.
>
>Here is the patch:--- modify.old  Thu Jul  5 16:58:20 2001
>+++ modify.c    Tue Jun 26 16:09:04 2001
>@@ -308,7 +308,9 @@
> 
>                if( rc != LDAP_SUCCESS ) {
>                        slap_mods_free( mod );
>+#ifdef HAVE_GETADDRINFO
>                        snprintf( textbuf, textlen, "%s: %s", ml->ml_type, text
>);
>+#endif
>                        *text = textbuf;
>                        return rc;
>                }
>@@ -321,9 +323,11 @@
>                        /* attribute requires binary transfer */
>                        slap_mods_free( mod );
> 
>+#ifdef HAVE_GETADDRINFO
>                        snprintf( textbuf, textlen,
>                                "%s: requires ;binary transfer",
>                                ml->ml_type );
>+#endif
>                        *text = textbuf;
>                        return LDAP_UNDEFINED_TYPE;
>                }
>@@ -333,9 +337,11 @@
>                {
>                        /* attribute requires binary transfer */
>                        slap_mods_free( mod );
>+#ifdef HAVE_GETADDRINFO
>                        snprintf( textbuf, textlen,
>                                "%s: disallows ;binary transfer",
>                                ml->ml_type );
>+#endif
>                        *text = textbuf;
>                        return LDAP_UNDEFINED_TYPE;
>                }
>@@ -343,9 +349,11 @@
>                if (!update && is_at_no_user_mod( ad->ad_type )) {
>                        /* user modification disallowed */
>                        slap_mods_free( mod );
>+#ifdef HAVE_GETADDRINFO
>                        snprintf( textbuf, textlen,
>                                "%s: no user modification allowed",
>                                ml->ml_type );
>+#endif
>                        *text = textbuf;
>                        return LDAP_CONSTRAINT_VIOLATION;
>                }
>@@ -358,9 +366,11 @@
>                         * only allow replace/delete with no values
>                         */
>                        slap_mods_free( mod );
>+#ifdef HAVE_GETADDRINFO
>                        snprintf( textbuf, textlen,
>                                "%s: attribute is obsolete",
>                                ml->ml_type );
>+#endif
>                        *text = textbuf;
>                        return LDAP_CONSTRAINT_VIOLATION;
>                }
>@@ -376,10 +386,12 @@
>                        if( !validate ) {
>                                slap_mods_free( mod );
>                                *text = "no validator for syntax";
>+#ifdef HAVE_GETADDRINFO
>                                snprintf( textbuf, textlen,
>                                        "%s: no validator for syntax %s",
>                                        ml->ml_type,
>                                        ad->ad_type->sat_syntax->ssyn_oid );
>+#endif
>                                *text = textbuf;
>                                return LDAP_INVALID_SYNTAX;
>                        }
>@@ -392,9 +404,11 @@
> 
>                                if( rc != 0 ) {
>                                        slap_mods_free( mod );
>+#ifdef HAVE_GETADDRINFO
>                                        snprintf( textbuf, textlen,
>                                                "%s: value #%ld contains invalid
>data",
>                                                ml->ml_type, (long) nvals );
>+#endif
>                                        *text = textbuf;
>                                        return LDAP_INVALID_SYNTAX;
>                                }
>@@ -408,9 +422,11 @@
>                                && nvals > 1 && is_at_single_value( ad->ad_type
>))
>                        {
>                                slap_mods_free( mod );
>+#ifdef HAVE_GETADDRINFO
>                                snprintf( textbuf, textlen,
>                                        "%s: multiple value provided",
>                                        ml->ml_type );
>+#endif
>                                *text = textbuf;
>                                return LDAP_INVALID_SYNTAX;
>                        }