]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-monitor/database.c
should we touch timestamps when internally updating?
[openldap] / servers / slapd / back-monitor / database.c
index ab298d5ec0d29372eb5d6868979b5c6488c6566c..1312d891a58004555e0986fccdd0a26d0821eb88 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2001-2004 The OpenLDAP Foundation.
+ * Copyright 2001-2005 The OpenLDAP Foundation.
  * Portions Copyright 2001-2003 Pierangelo Masarati.
  * All rights reserved.
  *
@@ -46,6 +46,14 @@ static int monitor_back_add_plugin( Backend *be, Entry *e );
 #include "../back-ldbm/back-ldbm.h"
 #endif /* defined(SLAPD_LDBM) */
 
+/* for PATH_MAX on some systems (e.g. Solaris) */
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif /* HAVE_LIMITS_H */
+#ifndef PATH_MAX
+#define PATH_MAX       4095
+#endif /* ! PATH_MAX */
+
 static struct restricted_ops_t {
        struct berval   op;
        unsigned int    tag;
@@ -336,12 +344,14 @@ monitor_subsys_database_init(
 
 #if defined(SLAPD_LDAP) 
                if ( strcmp( bi->bi_type, "ldap" ) == 0 ) {
-                       struct ldapinfo         *li = (struct ldapinfo *)be->be_private;
+                       struct ldapinfo         *li =
+                               (struct ldapinfo *)be->be_private;
                        struct berval           bv;
 
-                       bv.bv_val = li->url;
-                       bv.bv_len = strlen( bv.bv_val );
-                       attr_merge_normalize_one( e, slap_schema.si_ad_labeledURI,
+                       ber_str2bv( li->url, 0, 0, &bv );
+
+                       attr_merge_normalize_one( e,
+                                       slap_schema.si_ad_labeledURI,
                                        &bv, NULL );
                }
 #endif /* defined(SLAPD_LDAP) */