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

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



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;
                        }